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

Non-portable LDFLAGS in libpolys/polys/Makefile.am #1127

Closed
orlitzky opened this issue Jan 20, 2022 · 6 comments
Closed

Non-portable LDFLAGS in libpolys/polys/Makefile.am #1127

orlitzky opened this issue Jan 20, 2022 · 6 comments

Comments

@orlitzky
Copy link
Contributor

At https://github.com/Singular/Singular/blob/spielwiese/libpolys/polys/Makefile.am#L72 we have,

P_PROCS_MODULE_LDFLAGS = -shared -module -dynamic -export-dynamic -avoid-version -weak_reference_mismatches weak -undefined dynamic_lookup -flat_namespace

and several of those are non-portable. For example -weak_reference_mismatch and -flat_namespace are Darwin linker options. (I'm not sure what weak does?) This caused a build failure reported at https://bugs.gentoo.org/778563

In https://github.com/Singular/Singular/blob/spielwiese/m4/p-procs.m4, the AX_APPEND_LINK_FLAGS macro is used to append only those flags that are supported by the linker. Maybe the same can be done for the P_PROCS_MODULE_LDFLAGS variable?

@hannes14
Copy link
Member

fixed with 760a344

@orlitzky
Copy link
Contributor Author

Thank you!

@orlitzky
Copy link
Contributor Author

Now that I've tried this in real life, it looks like these flags are getting added back in by any dyn_modules the user chooses to build, e.g. https://github.com/Singular/Singular/blob/spielwiese/Singular/dyn_modules/Order/Makefile.am#L22

Maybe it's as simple as duplicating the AX_APPEND_LINK_FLAGS(..., [P_PROCS_MODULE_LDFLAGS]) to the top-level build system?

@orlitzky
Copy link
Contributor Author

Was 1db01d0 meant to address this? It does partially, by eliminating the failure due to -weak_reference_mismatches, but the -flat_namespace one still unfortunately remains. For example on Gentoo with slibtool (which won't ignore the error):

rlibtool: link: x86_64-pc-linux-gnu-g++ .libs/subsets_la-subsets.o -O2 -pipe -march=native -fno-common -flat_namespace -Wl,-O1 -Wl,--as-needed -pipe -fno-common -rdynamic -Wl,-undefined,dynamic_lookup -lcddgmp -lreadline -lmpfr -lgmp -lrt -shared -fPIC -Wl,-soname -Wl,subsets.so -o .libs/subsets.so -Wl,--export-dynamic
x86_64-pc-linux-gnu-g++: error: unrecognized command-line option '-flat_namespace'

I wish I could be of more use debugging this (since it's a niche problem) but I have no access to macOS.

@hannes14
Copy link
Member

should be fixed with 8300693

@orlitzky
Copy link
Contributor Author

should be fixed with 8300693

Indeed, 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

No branches or pull requests

2 participants