Opened 8 months ago

Closed 7 months 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 8 months ago by jdemeyer

  • Cc fbissey added

Replying to thansen:

According to the report the libraries should be placed after the object files for this to work

It would be good if somebody could confirm that this is indeed the problem.

François, aren't you using --as-needed on Gentoo?

comment:2 Changed 8 months ago by thansen

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 8 months ago by fbissey

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 8 months ago by thansen

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 7 months ago by thansen

  • 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 7 months ago by jdemeyer

  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.