@@ -770,7 +770,11 @@ def build(bld):
770770 '-Wl,-rpath=' + SYSROOT + '/lib64' ,
771771 '-Wl,--dynamic-linker=' + SYSROOT + '/lib64/ld-2.31.so'
772772 ]
773- bld .env .append_value ('LINKFLAGS' ,extra_cflags_root )
773+ wl_end_group = [
774+ '-Wl,--end-group'
775+ ]
776+
777+ bld .env .append_value ('LINKFLAGS' ,extra_cflags_root + wl_end_group )
774778 module_source = module_source + kernel_source
775779 module_headers = module_headers + kernel_headers
776780 uselib = ns3waf .modules_uselib (bld , ['core' , 'network' , 'internet' , 'netlink' ])
@@ -779,7 +783,7 @@ def build(bld):
779783 headers = module_headers ,
780784 use = uselib ,
781785 includes = kernel_includes ,
782- cxxflags = extra_cflags_root + ['-Wno-deprecated-declarations' ],
786+ cxxflags = extra_cflags_root + ['-Wno-deprecated-declarations' ]+ wl_end_group ,
783787 lib = ['dl' ])
784788# lib=['dl','efence'])
785789
@@ -832,7 +836,7 @@ def build(bld):
832836 # and forward to the dce_* code
833837 bld .shlib (source = ['model/libc.cc' , 'model/libc-setup.cc' , 'model/libc-global-variables.cc' ],
834838 target = 'lib/c-ns3' ,
835- cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ],
839+ cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ]+ wl_end_group ,
836840 defines = ['LIBSETUP=libc_setup' ],
837841 linkflags = ['-nostdlib' , '-fno-profile-arcs' ,
838842 '-Wl,--version-script=' + os .path .join ('model' , 'libc.version' ),
@@ -841,7 +845,7 @@ def build(bld):
841845 # and forward to the dce_* code
842846 bld .shlib (source = ['model/libc.cc' , 'model/libc-setup.cc' ],
843847 target = 'lib/pthread-ns3' ,
844- cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ],
848+ cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ]+ wl_end_group ,
845849 defines = ['LIBSETUP=libpthread_setup' ],
846850 linkflags = ['-nostdlib' , '-fno-profile-arcs' ,
847851 '-Wl,--version-script=' + os .path .join ('model' , 'libpthread.version' ),
@@ -851,7 +855,7 @@ def build(bld):
851855 # and forward to the dce_* code
852856 bld .shlib (source = ['model/libc.cc' , 'model/libc-setup.cc' ],
853857 target = 'lib/rt-ns3' ,
854- cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ],
858+ cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ]+ wl_end_group ,
855859 defines = ['LIBSETUP=librt_setup' ],
856860 linkflags = ['-nostdlib' , '-fno-profile-arcs' ,
857861 '-Wl,--version-script=' + os .path .join ('model' , 'librt.version' ),
@@ -861,7 +865,7 @@ def build(bld):
861865 # and forward to the dce_* code
862866 bld .shlib (source = ['model/libc.cc' , 'model/libc-setup.cc' ],
863867 target = 'lib/m-ns3' ,
864- cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ],
868+ cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ]+ wl_end_group ,
865869 defines = ['LIBSETUP=libm_setup' ],
866870 linkflags = ['-nostdlib' , '-fno-profile-arcs' ,
867871 '-Wl,--version-script=' + os .path .join ('model' , 'libm.version' ),
@@ -871,7 +875,7 @@ def build(bld):
871875 # and forward to the dce_* code
872876 bld .shlib (source = ['model/libc.cc' , 'model/libc-setup.cc' ],
873877 target = 'lib/dl-ns3' ,
874- cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ],
878+ cxxflags = extra_cflags_root + ['-g' , '-fno-profile-arcs' , '-fno-test-coverage' , '-Wno-builtin-declaration-mismatch' ]+ wl_end_group ,
875879 defines = ['LIBSETUP=libdl_setup' ],
876880 linkflags = ['-nostdlib' , '-fno-profile-arcs' ,
877881 '-Wl,--version-script=' + os .path .join ('model' , 'libdl.version' ),
0 commit comments