Skip to content

Commit

Permalink
libgcc/whole-archive cleanup
Browse files Browse the repository at this point in the history
* add libgcc as whole-archive to 'ldlibs_so' in flags.tcl
* remove unnecessary 'whole-archive' entries from qmake.tcl and cmake.tcl
* remove unnecessary and unused globals of 'ldlibs_so'

issue genodelabs#68
  • Loading branch information
ssumpf authored and jschlatow committed Nov 16, 2023
1 parent 81ced02 commit f219ab3
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions share/goa/lib/build/autoconf.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ proc create_or_update_build_dir { } {
mirror_source_dir_to_build_dir

global build_dir cross_dev_prefix project_name project_dir
global cppflags cflags cxxflags ldflags ldlibs_common ldlibs_exe ldlibs_so
global cppflags cflags cxxflags ldflags ldlibs_common ldlibs_exe

# invoke configure script only once
if {[file exists [file join $build_dir config.status]]} {
Expand Down Expand Up @@ -74,7 +74,7 @@ proc create_or_update_build_dir { } {

proc build { } {

global build_dir verbose project_name jobs project_dir ldlibs_common ldlibs_exe ldlibs_so
global build_dir verbose project_name jobs project_dir ldlibs_common ldlibs_exe

set cmd { }

Expand Down
2 changes: 1 addition & 1 deletion share/goa/lib/build/cargo.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ proc generate_static_stubs { libs } {
proc build { } {

global build_dir cross_dev_prefix verbose debug project_name jobs project_dir
global cppflags cflags cxxflags ldflags ldlibs_common ldlibs_exe ldlibs_so lib_src
global cppflags cflags cxxflags ldflags ldlibs_common ldlibs_exe lib_src
global cc_march

set rustflags { }
Expand Down
3 changes: 0 additions & 3 deletions share/goa/lib/build/cmake.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ proc create_or_update_build_dir { } {
set orig_pwd [pwd]
cd $build_dir

lappend ldflags "-Wl,--whole-archive"
lappend ldlibs_common -Wl,--whole-archive -lgcc -Wl,--no-whole-archive

set ::env(LDFLAGS) "$ldflags $ldlibs_common $ldlibs_exe"

set cmd { }
Expand Down
2 changes: 1 addition & 1 deletion share/goa/lib/build/make.tcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
proc _make_cmd { } {
global build_dir cross_dev_prefix verbose jobs project_dir
global cppflags cflags cxxflags ldflags ldlibs_common ldlibs_exe ldlibs_so lib_src
global cppflags cflags cxxflags ldflags ldlibs_common ldlibs_exe lib_src

set cmd { }

Expand Down
2 changes: 0 additions & 2 deletions share/goa/lib/build/qmake.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,11 @@ proc create_or_update_build_dir { } {
lappend qmake_ldlibs -l:stdcxx.lib.so
lappend qmake_ldlibs -l:qt5_component.lib.so

lappend qmake_ldlibs -Wl,--whole-archive
if {$arch == "x86_64"} {
lappend qmake_ldlibs [file normalize [exec $cross_dev_prefix\gcc -m64 -print-libgcc-file-name]]
} else {
lappend qmake_ldlibs [file normalize [exec $cross_dev_prefix\gcc -print-libgcc-file-name]]
}
lappend qmake_ldlibs -Wl,--no-whole-archive

set ::env(GENODE_QMAKE_CC) "${cross_dev_prefix}gcc"
set ::env(GENODE_QMAKE_CXX) "${cross_dev_prefix}g++"
Expand Down
2 changes: 1 addition & 1 deletion share/goa/lib/flags.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ lappend ldlibs_exe -T [file join $ld_script_dir genode_dyn.ld]

set ldlibs_so { }
lappend ldlibs_so -Wl,-shared
lappend ldlibs_so -Wl,--whole-archive -l:ldso_so_support.lib.a -Wl,--no-whole-archive
lappend ldlibs_so -Wl,--whole-archive -lgcc -l:ldso_so_support.lib.a -Wl,--no-whole-archive
lappend ldlibs_so -T [file join $ld_script_dir genode_rel.ld]

# determine ABIs to link against the executable
Expand Down

0 comments on commit f219ab3

Please sign in to comment.