Opened 3 years ago
Closed 3 years ago
#27204 closed defect (worksforme)
Fix linking with --as-needed
Reported by: | thansen | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | build | Keywords: | |
Cc: | fbissey | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
Linking with LDFLAGS = -Wl,--as-needed
fails due to wrong ordering of arguments. This option is the default in Ubuntu and it was reported in https://bugs.debian.org/919573 . According to the report the libraries should be placed after the object files for this to work, which is not always the case.
Change History (6)
comment:1 in reply to: ↑ description Changed 3 years ago by
- Cc fbissey added
comment:2 Changed 3 years ago by
Now that I'm looking again at the Debian bug report, in the example there the libraries do come after the object file. Let me test myself if the Debian package builds with --as-needed.
Importance of linking order is also mentioned here: https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed#Importance_of_linking_order
comment:3 Changed 3 years ago by
It is the default on Gentoo and its been some time since I have seen an issue like that in sage itself. I'll have to inspect my build logs to see if I have the order correct.
comment:4 Changed 3 years ago by
I didn't have a problem building with --as-needed
, so I suspect the reporter of the Debian bug just encountered an issue caused by #27205 and confused the object (*.o) with the output (*.so) file (which comes after the libraries). Let's see what they answer.
comment:5 Changed 3 years ago by
- Milestone changed from sage-8.7 to sage-duplicate/invalid/wontfix
After fixing #27205, sagemath builds again on Ubuntu, so there was never a problem with --as-needed.
comment:6 Changed 3 years ago by
- Resolution set to worksforme
- Status changed from new to closed
Replying to thansen:
It would be good if somebody could confirm that this is indeed the problem.
François, aren't you using
--as-needed
on Gentoo?