@@ -774,7 +774,11 @@ def build(bld):
774774 '-Wl,-rpath=' + SYSROOT + '/lib64' ,
775775 '-Wl,--dynamic-linker=' + SYSROOT + '/lib64/ld-2.31.so'
776776 ]
777- bld .env .append_value ('LINKFLAGS' ,extra_cflags_root )
777+ wl_end_group = [
778+ '-Wl,--end-group'
779+ ]
780+
781+ bld .env .append_value ('LINKFLAGS' ,extra_cflags_root + wl_end_group )
778782 module_source = module_source + kernel_source
779783 module_headers = module_headers + kernel_headers
780784 uselib = ns3waf .modules_uselib (bld , ['core' , 'network' , 'internet' , 'netlink' ])
@@ -783,7 +787,7 @@ def build(bld):
783787 headers = module_headers ,
784788 use = uselib ,
785789 includes = kernel_includes ,
786- cxxflags = extra_cflags_root + ['-Wno-deprecated-declarations' ],
790+ cxxflags = extra_cflags_root + ['-Wno-deprecated-declarations' ]+ wl_end_group ,
787791 lib = ['dl' ])
788792# lib=['dl','efence'])
789793
@@ -836,7 +840,7 @@ def build(bld):
836840 # and forward to the dce_* code
837841 bld .shlib (source = ['model/libc.cc' , 'model/libc-setup.cc' , 'model/libc-global-variables.cc' ],
838842 target = 'lib/c-ns3' ,
839- cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ],
843+ cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ]+ wl_end_group ,
840844 defines = ['LIBSETUP=libc_setup' ],
841845 linkflags = ['-nostdlib' , '-fno-profile-arcs' ,
842846 '-Wl,--version-script=' + os .path .join ('model' , 'libc.version' ),
@@ -845,7 +849,7 @@ def build(bld):
845849 # and forward to the dce_* code
846850 bld .shlib (source = ['model/libc.cc' , 'model/libc-setup.cc' ],
847851 target = 'lib/pthread-ns3' ,
848- cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ],
852+ cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ]+ wl_end_group ,
849853 defines = ['LIBSETUP=libpthread_setup' ],
850854 linkflags = ['-nostdlib' , '-fno-profile-arcs' ,
851855 '-Wl,--version-script=' + os .path .join ('model' , 'libpthread.version' ),
@@ -855,7 +859,7 @@ def build(bld):
855859 # and forward to the dce_* code
856860 bld .shlib (source = ['model/libc.cc' , 'model/libc-setup.cc' ],
857861 target = 'lib/rt-ns3' ,
858- cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ],
862+ cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ]+ wl_end_group ,
859863 defines = ['LIBSETUP=librt_setup' ],
860864 linkflags = ['-nostdlib' , '-fno-profile-arcs' ,
861865 '-Wl,--version-script=' + os .path .join ('model' , 'librt.version' ),
@@ -865,7 +869,7 @@ def build(bld):
865869 # and forward to the dce_* code
866870 bld .shlib (source = ['model/libc.cc' , 'model/libc-setup.cc' ],
867871 target = 'lib/m-ns3' ,
868- cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ],
872+ cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ]+ wl_end_group ,
869873 defines = ['LIBSETUP=libm_setup' ],
870874 linkflags = ['-nostdlib' , '-fno-profile-arcs' ,
871875 '-Wl,--version-script=' + os .path .join ('model' , 'libm.version' ),
@@ -875,7 +879,7 @@ def build(bld):
875879 # and forward to the dce_* code
876880 bld .shlib (source = ['model/libc.cc' , 'model/libc-setup.cc' ],
877881 target = 'lib/dl-ns3' ,
878- cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ],
882+ cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ]+ wl_end_group ,
879883 defines = ['LIBSETUP=libdl_setup' ],
880884 linkflags = ['-nostdlib' , '-fno-profile-arcs' ,
881885 '-Wl,--version-script=' + os .path .join ('model' , 'libdl.version' ),
0 commit comments