Skip to content

Commit

Permalink
Unified executables fixes (#1585)
Browse files Browse the repository at this point in the history
These changes ensure that runtime libraries are copied to the target for
unified executables, and ensure that symbols in unified executables are
still exported to allow backtraces.
  • Loading branch information
housel authored May 4, 2024
2 parents c1d5a7e + b341067 commit fbdb24b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions documentation/release-notes/source/2024.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ this release.
Compiler
========

* Unified executables now export symbols so that call stack dumping
works properly.

* The build rules for unified executables now properly depend on
copying included run-time libraries such as libunwind.

Tools
=====

Expand Down
12 changes: 6 additions & 6 deletions sources/jamfiles/posix-build.jam
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ rule DylanLibrary image : version {
local _rtlib = $(_i:D=) ;
MakeLocate $(_rtlib) : $(LIBDIR) ;
File $(_rtlib) : $(_i) ;
Depends $(_dll) : $(_rtlib) ;
Depends $(_dll) $(_ulib) : $(_rtlib) ;
}
}

Expand Down Expand Up @@ -486,7 +486,7 @@ rule LinkDLL {

actions together LinkDLL bind NEEDLIBS {
$(LINK) -shared -o $(<:Q) $(LINKFLAGS) $(>:Q) -L"$(LIBPATH)" $(NEEDLIBS:Q) $(LINKLIBS)
$(OBJCOPY) $(<:Q) $(<:Q).dbg
$(OBJCOPY) --only-keep-debug $(<:Q) $(<:Q).dbg
$(STRIP) -s $(<:Q)
$(OBJCOPY) --add-gnu-debuglink=$(<:Q).dbg $(<:Q)
}
Expand All @@ -507,7 +507,7 @@ rule LinkEXE {

actions LinkEXE bind NEEDLIBS {
$(LINK) -o $(<:Q) $(LINKFLAGS) $(>:Q) -L"$(LIBPATH)" $(NEEDLIBS:Q) $(LINKLIBS)
$(OBJCOPY) $(<:Q) $(<:Q).dbg
$(OBJCOPY) --only-keep-debug $(<:Q) $(<:Q).dbg
$(STRIP) -s $(<:Q)
$(OBJCOPY) --add-gnu-debuglink=$(<:Q).dbg $(<:Q)
}
Expand All @@ -518,9 +518,9 @@ rule UnifyEXE {
}

actions UnifyEXE bind NEEDLIBS {
$(UNIFYLINK) -o $(<:Q) $(LINKFLAGS) $(>:Q) -L"$(LIBPATH)" -Wl,--start-group $(NEEDLIBS:Q) $(LINKLIBS) -Wl,--end-group
$(OBJCOPY) $(<:Q) $(<:Q).dbg
$(STRIP) -s $(<:Q)
$(UNIFYLINK) -o $(<:Q) $(LINKFLAGS) -Wl,-E $(>:Q) -L"$(LIBPATH)" -Wl,--start-group $(NEEDLIBS:Q) $(LINKLIBS) -Wl,--end-group
$(OBJCOPY) --only-keep-debug $(<:Q) $(<:Q).dbg
$(STRIP) -g $(<:Q)
$(OBJCOPY) --add-gnu-debuglink=$(<:Q).dbg $(<:Q)
}

Expand Down

0 comments on commit fbdb24b

Please sign in to comment.