From 47eeaf45b510d056efcd5382550ed73e4d1af377 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Mon, 8 Jan 2018 12:28:08 +0100 Subject: Separate general linking flags from extra libraries So far, we've placed all extra library related flags together, ending up in the make variable EX_LIBS. This turns out to be problematic, as for example, some compilers don't quite agree with something like this: cc -o foo foo.o -L/whatever -lsomething They prefer this: cc -L/whatever -o foo foo.o -lsomething IBM's compiler on OS/390 is such a compiler that we know of, and we have previously handled that as a previous case. The answer here is to make a more general solution, where linking options are divided in two parts, where one ends up in LDFLAGS and the other in EX_LIBS (they corresponds to what is called LDFLAGS and LDLIBS in the GNU world) Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/5033) --- Configurations/10-main.conf | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'Configurations/10-main.conf') diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf index 08bb839de5..bc7c496351 100644 --- a/Configurations/10-main.conf +++ b/Configurations/10-main.conf @@ -169,7 +169,7 @@ my %targets = ( release => "-O3"), thread_scheme => "(unknown)", sys_id => "VOS", - lflags => "-Wl,-map", + lflags => add("-Wl,-map"), bn_ops => "BN_LLONG", shared_extension => ".so", }, @@ -564,7 +564,8 @@ my %targets = ( cc => "gcc", cflags => "-D_ENDIAN -DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB", sys_id => "MPE", - ex_libs => add("-L/SYSLOG/PUB -lsyslog -lsocket -lcurses"), + lflags => add("-L/SYSLOG/PUB"), + ex_libs => add("-lsyslog -lsocket -lcurses"), thread_scheme => "(unknown)", bn_ops => "BN_LLONG", }, @@ -1384,10 +1385,10 @@ my %targets = ( : " /MC"; }), debug => "/Od -DDEBUG -D_DEBUG", release => "/O1i"), - lflags => combine("/nologo /opt:ref", - sub { vc_wince_info()->{lflags}; }, - sub { defined(env('PORTSDK_LIBPATH')) - ? "/entry:mainCRTstartup" : (); }), + lflags => add(combine("/nologo /opt:ref", + sub { vc_wince_info()->{lflags}; }, + sub { defined(env('PORTSDK_LIBPATH')) + ? "/entry:mainCRTstartup" : (); })), sys_id => "WINCE", bn_ops => "BN_LLONG EXPORT_VAR_AS_FN", ex_libs => add(sub { @@ -1639,49 +1640,51 @@ my %targets = ( cc => "ccppc", cflags => "-D_REENTRANT -mrtp -mhard-float -mstrict-align -fno-implicit-fp -DPPC32_fp60x -O2 -fstrength-reduce -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip", sys_id => "VXWORKS", - ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"), + lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"), + ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"), }, "vxworks-ppcgen" => { inherit_from => [ "BASE_unix" ], cc => "ccppc", cflags => "-D_REENTRANT -mrtp -msoft-float -mstrict-align -O1 -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip", sys_id => "VXWORKS", - ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"), + lflags => add("-L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"), + ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"), }, "vxworks-ppc405" => { inherit_from => [ "BASE_unix" ], cc => "ccppc", cflags => "-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h", sys_id => "VXWORKS", - lflags => "-r", + lflags => add("-r"), }, "vxworks-ppc750" => { inherit_from => [ "BASE_unix" ], cc => "ccppc", cflags => "-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG)", sys_id => "VXWORKS", - lflags => "-r", + lflags => add("-r"), }, "vxworks-ppc750-debug" => { inherit_from => [ "BASE_unix" ], cc => "ccppc", cflags => "-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DPEDANTIC -DDEBUG -g", sys_id => "VXWORKS", - lflags => "-r", + lflags => add("-r"), }, "vxworks-ppc860" => { inherit_from => [ "BASE_unix" ], cc => "ccppc", cflags => "-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h", sys_id => "VXWORKS", - lflags => "-r", + lflags => add("-r"), }, "vxworks-simlinux" => { inherit_from => [ "BASE_unix" ], cc => "ccpentium", cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DL_ENDIAN -DCPU=SIMLINUX -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/h -I\$(WIND_BASE)/target/h/wrn/coreip -DOPENSSL_NO_HW_PADLOCK", sys_id => "VXWORKS", - lflags => "-r", + lflags => add("-r"), ranlib => "ranlibpentium", }, "vxworks-mips" => { @@ -1690,7 +1693,8 @@ my %targets = ( cflags => combine("-mrtp -mips2 -O -G 0 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DCPU=MIPS32 -msoft-float -mno-branch-likely -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/h/wrn/coreip", threads("-D_REENTRANT")), sys_id => "VXWORKS", - ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"), + lflags => add("-L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"), + ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000"), thread_scheme => "pthreads", perlasm_scheme => "o32", ranlib => "ranlibmips", -- cgit v1.2.3