Skip to content

Commit

Permalink
Add -lc and -pthread to shared library builds
Browse files Browse the repository at this point in the history
The option -nostdlib that is used for shared library builds also
removes -lc and -pthread. While this does not immediately cause problems
when building the shared version of the runtime it won't use the correct
symbol versions causing it to use the wrong version of some libc
symbols.

ref eng/cert/certified-rts#145
  • Loading branch information
jklmnn committed Nov 12, 2024
1 parent 3f82b97 commit c0c0517
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions support/data/target_options.gpr.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ abstract project Target_Options is
-- link against libgnat (itself).
-- Since -nostdlib also removes libgcc
-- from the linked libraries we have to
-- add -lgcc again.
LOPTIONS := LOPTIONS & ("-nostdlib", "-lgcc");
-- add -lc and -lgcc again.
-- Also add -pthread in case it is not already included in -lc.
LOPTIONS := LOPTIONS & ("-nostdlib", "-lc", "-lgcc", "-pthread");
end case;

-- Concatenate with common flags
Expand Down

0 comments on commit c0c0517

Please sign in to comment.