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

linker: add all required libs when linking #25

Merged
merged 2 commits into from
Mar 16, 2023

Conversation

benlorenz
Copy link
Contributor

Otherwise this fails with many undefined symbols errors on platforms that don't use allow-undefined by default (e.g. macOS).

For example this for the library:

[20:06:30] /opt/bin/aarch64-apple-darwin20-libgfortran5-cxx11/aarch64-apple-darwin20-clang++ --sysroot=/opt/aarch64-apple-darwin20/aarch64-apple-darwin20/sys-root  -Wall -Wextra -Wunused -Wsign-compare -fno-omit-frame-pointer -Wtype-limits -Wuninitialized -Wno-deprecated -Wstrict-aliasing -Wpointer-arith -Wheader-guard -Wpointer-arith -Wformat-nonliteral -Winit-self -Wparentheses -Wunreachable-code -ggdb3 -O2 -g  -mmacosx-version-min=11.0 -dynamiclib -Wl,-headerpad_max_install_names  -O2 -compatibility_version 1.0.0 -current_version 1.0.0 -o libganak.1.0.dylib -install_name @rpath/libganak.1.0.dylib CMakeFiles/ganak.dir/alt_component_analyzer.cpp.o CMakeFiles/ganak.dir/component_analyzer.cpp.o CMakeFiles/ganak.dir/component_cache.cpp.o CMakeFiles/ganak.dir/component_management.cpp.o CMakeFiles/ganak.dir/instance.cpp.o CMakeFiles/ganak.dir/new_component_analyzer.cpp.o CMakeFiles/ganak.dir/solver.cpp.o CMakeFiles/ganak.dir/statistics.cpp.o CMakeFiles/ganak.dir/GitSHA1.cpp.o  clhash/libclhash.dylib component_types/libcomponent_types.dylib          
[20:06:30] Undefined symbols for architecture arm64:
[20:06:30]   "___gmp_get_memory_functions", referenced from:
[20:06:30]       __ZNK10__gmp_exprIA1_12__mpz_structS1_E7get_strEi in statistics.cpp.o
[20:06:30]       __ZN19__gmp_alloc_cstringD2Ev in statistics.cpp.o
...

I also did get some missing symbols for linking the binary which is why I added LIB there but I cannot reproduce this anymore right now.

cc: @lkastner

otherwise this fails with many undefined symbols errors on platforms
that don't use allow-undefined by default (e.g. macos)
@benlorenz
Copy link
Contributor Author

I also did get some missing symbols for linking the binary which is why I added LIB there but I cannot reproduce this anymore right now.

I removed that second part again since I still cannot reproduce the error even after some more experiments.

@msoos msoos merged commit f8a6616 into meelgroup:master Mar 16, 2023
@msoos
Copy link
Collaborator

msoos commented Mar 16, 2023

Ah, nice catch, thank you!

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.

3 participants