Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Exiv2 #3503

Merged
merged 4 commits into from
Aug 17, 2021
Merged

add Exiv2 #3503

merged 4 commits into from
Aug 17, 2021

Conversation

Crghilardi
Copy link
Contributor

Add a build_tarballs.jl for the Exiv2 library

Tested locally on linux-gnu, linux-musl and mingw with no issues.

E/Exiv2/build_tarballs.jl Outdated Show resolved Hide resolved
E/Exiv2/build_tarballs.jl Outdated Show resolved Hide resolved
@Crghilardi
Copy link
Contributor Author

Crghilardi commented Aug 16, 2021

I don't quite understand what is going on with the i686-linux-musl-cxx11 check, especially when the i686-linux-musl-cxx03 one passes?

[19:28:21] CMakeFiles/exiv2lib.dir/basicio.cpp.o: In function `Exiv2::FileIo::write(Exiv2::BasicIo&) [clone .part.25] [clone .constprop.97]':
[19:28:21] basicio.cpp:(.text+0xa64): undefined reference to `__stack_chk_fail_local'
[19:28:21] CMakeFiles/exiv2lib.dir/basicio.cpp.o: In function `Exiv2::RemoteIo::path[abi:cxx11]() const':
[19:28:21] basicio.cpp:(.text+0xc44): undefined reference to `__stack_chk_fail_local'
[19:28:21] CMakeFiles/exiv2lib.dir/basicio.cpp.o: In function `Exiv2::FileIo::path[abi:cxx11]() const [clone .localalias.80]':
[19:28:21] basicio.cpp:(.text+0xd14): undefined reference to `__stack_chk_fail_local'
[19:28:21] CMakeFiles/exiv2lib.dir/basicio.cpp.o: In function `Exiv2::FileIo::Impl::Impl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
[19:28:21] basicio.cpp:(.text+0xf75): undefined reference to `__stack_chk_fail_local'
[19:28:21] CMakeFiles/exiv2lib.dir/basicio.cpp.o: In function `Exiv2::FileIo::Impl::stat(Exiv2::FileIo::Impl::StructStat&) const':
[19:28:21] basicio.cpp:(.text+0x165c): undefined reference to `__stack_chk_fail_local'
[19:28:21] CMakeFiles/exiv2lib.dir/basicio.cpp.o:basicio.cpp:(.text+0x16f9): more undefined references to `__stack_chk_fail_local' follow
[19:28:21] collect2: error: ld returned 1 exit status

I tried adding a preferred_gcc version with 5,6,and 7 unsuccessfully (edit: also tried 8 and 9, didn't work....). I have also tried adding a -DBUILD_WITH_STACK_PROTECTOR flag with the same result.

The 0.27.4 release is listed as 499 commit behind master so I haven't been able to find any patches in master worth pulling out yet.

@giordano
Copy link
Member

giordano commented Aug 16, 2021

I don't quite understand what is going on with the i686-linux-musl-cxx11 check,

We've got the same issues with __stack_chk_fail_local in #845 and #3249, in both cases I think we ended up not going through that code path

especially when the i686-linux-musl-cxx03 one passes?

That uses GCC 4.8, the C++11 string ABI necessarily requires GCC 5 (well, 4.9 but we don't have it), maybe that's relevant

@Crghilardi
Copy link
Contributor Author

Crghilardi commented Aug 17, 2021

So the issue came down to the addition of a -fstack-protector-strong flag in i686-linux-musl-cxx11 build from a series of check_cxx_compiler_flag statements that was not included in the cxx03 build. Apparently, gcc emits slightly different code for 32 bit stack stuff and musl takes a slightly different stance on how this should all be handled.

i686-linux-musl-cxx11 CMake output


[19:28:14] -- Performing Test HAS_FSTACK_CLASH_PROTECTION
[19:28:14] -- Performing Test HAS_FSTACK_CLASH_PROTECTION - Failed
[19:28:14] -- Performing Test HAS_FCF_PROTECTION
[19:28:14] -- Performing Test HAS_FCF_PROTECTION - Failed
[19:28:14] -- Performing Test HAS_FSTACK_PROTECTOR_STRONG
[19:28:15] -- Performing Test HAS_FSTACK_PROTECTOR_STRONG - Success


[19:28:16] -- CMAKE_CXX_STANDARD:
[19:28:16] --  --- Compiler flags --- 
[19:28:16] -- General:           
[19:28:16] 	 -fstack-protector-strong
[19:28:16] 	 -Wp,-D_GLIBCXX_ASSERTIONS
[19:28:16] 	 -Wp,-D_FORTIFY_SOURCE=2
[19:28:16] 	 -Wall
[19:28:16] 	 -Wcast-align
[19:28:16] 	 -Wpointer-arith
[19:28:16] 	 -Wformat-security
[19:28:16] 	 -Wmissing-format-attribute
[19:28:16] 	 -Woverloaded-virtual
[19:28:16] 	 -W

i686-linux-musl-cxx03 CMake output


[19:27:18] -- Performing Test HAS_FSTACK_CLASH_PROTECTION
[19:27:18] -- Performing Test HAS_FSTACK_CLASH_PROTECTION - Failed
[19:27:18] -- Performing Test HAS_FCF_PROTECTION
[19:27:18] -- Performing Test HAS_FCF_PROTECTION - Failed
[19:27:18] -- Performing Test HAS_FSTACK_PROTECTOR_STRONG
[19:27:18] -- Performing Test HAS_FSTACK_PROTECTOR_STRONG - Failed

[19:27:20] -- CMake Generator:   Unix Makefiles
[19:27:20] -- CMAKE_BUILD_TYPE:  Release
[19:27:20] -- Compiler info: GNU (/opt/bin/i686-linux-musl-libgfortran3-cxx03/i686-linux-musl-g++) ; version: 4.8.5
[19:27:20] -- CMAKE_CXX_STANDARD:
[19:27:20] --  --- Compiler flags --- 
[19:27:20] -- General:           
[19:27:20] 	 -Wp,-D_GLIBCXX_ASSERTIONS
[19:27:20] 	 -Wp,-D_FORTIFY_SOURCE=2
[19:27:20] 	 -Wall
[19:27:20] 	 -Wcast-align
[19:27:20] 	 -Wpointer-arith
[19:27:20] 	 -Wformat-security
[19:27:20] 	 -Wmissing-format-attribute
[19:27:20] 	 -Woverloaded-virtual
[19:27:20] 	 -W

@Crghilardi
Copy link
Contributor Author

Crghilardi commented Aug 17, 2021

@giordano I was reading in this thread that this might be handled in some form by libssp (or -libssp_nonshared?). It looks like that gets disabled in the BB musl builds?. Am I understanding that correctly and we are disabling libssp for BB?

Edit: #739 related

Copy link
Member

@giordano giordano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great detective work! I think this is a good solution for the time being, also because i686-linux-musl is the only platform for which Julia doesn't really work, so not many people are going to complain anyway if this breaks anything 😄

E/Exiv2/build_tarballs.jl Outdated Show resolved Hide resolved
@giordano giordano enabled auto-merge (squash) August 17, 2021 23:02
@giordano giordano merged commit 0847352 into JuliaPackaging:master Aug 17, 2021
@Crghilardi Crghilardi deleted the add-exiv2 branch August 18, 2021 03:18
simeonschaub pushed a commit to simeonschaub/Yggdrasil that referenced this pull request Feb 23, 2022
* initial commit Exiv2 build_tarballs.jl

* remove gettext, add newline at eof, make musl expat delete more specific

* add patch for i686-linux-musl to get around strong stack protection issues

* Update E/Exiv2/build_tarballs.jl

Co-authored-by: Mosè Giordano <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants