From patchwork Mon Jul 17 20:02:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 72808 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A1DAF3858284 for ; Mon, 17 Jul 2023 20:02:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1DAF3858284 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689624179; bh=Lxc1BRULZt1t+LvcfRzqSBwXPAzBJ4E6987yGWGKXM8=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=kNOtIGhRBZbm9wnnVGsiIIQr1GBVaUBksKTW60KAh+W1Cf9abVcrn1iD5ZaOJrj2G 5WX9U9cAOfahlpb3FO34DgpugMv0doj/GB0EukzL9zAF/RNke5G0qc4DgtKxv/wgum D1gr/H6Tlb5oqOWye9u25yYnBJv3tnzPPxNtGkNI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by sourceware.org (Postfix) with ESMTPS id 8EAEB3858C39 for ; Mon, 17 Jul 2023 20:02:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8EAEB3858C39 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0250B6124A; Mon, 17 Jul 2023 20:02:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59CC0C433CA; Mon, 17 Jul 2023 20:02:26 +0000 (UTC) To: libc-alpha@sourceware.org Cc: Alejandro Colomar , Adhemerval Zanella Netto Subject: [PATCH v1b 2/3] Makeconfig: Use one line per token Date: Mon, 17 Jul 2023 22:02:19 +0200 Message-Id: <20230717200220.569481-3-alx@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230717200220.569481-1-alx@kernel.org> References: <20230717200220.569481-1-alx@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=32158; i=alx@kernel.org; h=from:subject; bh=oOTsn+aB0z1idTVOLJS7NhYDJcBRqMwFdzIs4SL2Rlw=; b=owEBbQKS/ZANAwAKAZ6MGvu+/9syAcsmYgBktZ40ruWdAnT1eyi228ki86pAm1sUsjW7+UbBI pA6ijNlg2eJAjMEAAEKAB0WIQTqOofwpOugMORd8kCejBr7vv/bMgUCZLWeNAAKCRCejBr7vv/b MgrUEACG7IYGQq0CgdqjpPyat9jWODz401k3EMNGwtbu9UDwdde9o1cHU8zw8ZhhTlum2/9TeFh iy+OoQLn/rxSzpsWxH+YKMfUeECy8tF8sJT6+YhAWiVTAFxeVr4hXQ9Ke/ln+ZEowlBc8xxuZKF wZpHAyxTZrfUyIccVM96geX0fjSFXyVtlQgdDY+i2PfbsgYQ6i5gH3rABqkaRUvPkb9/JxKjPq4 621JSIw2PxS6Xsygd+653d/LUAUkKL5xKdI74dBT8NcEMxwD9Hm8A4vFicbW3xB54su2ykaxhF/ 7+s1KoWG5oeeDHa99fd+mtr5vZ/qIGUIdEAcb6OeAeI2GsznVB7kaExRHRx6ZI3Z2Bv50moM2by YRUEpT9nYsyzRScI7i2TcJaWiGwQ28/JVrFTOSy2dkmNeXcRDq7ZNiaup8STDx9DJPSTitXPkCM Hvpfr38DwNUxAZcwqukT/Z+r4vpkra+gFyBh1xEHiDY0dhNQwENPRgQQJuUQb+y48G9EFjFLp9a AXBkiqEuzbfB02ZkK5C04tlWSXvppXkifIsu2R2+zeDGAtsJoGaYGGOYFQGb2lrkWt0Z7RT0UPk VAc1oO693ItI8T7YTrJoClO2346dOiHndGm7eZ/UI0ipWq441DjgE4t8fidYEBRhuBUweyjON9E ou25OPX3f5gR81w== X-Developer-Key: i=alx@kernel.org; a=openpgp; fpr=A9348594CE31283A826FBDD8D57633D441E25BB5 X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alejandro Colomar via Libc-alpha From: Alejandro Colomar Reply-To: Alejandro Colomar Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" After this change, patches will be more clear about what they change, as they won't need to reflow lines. Cc: Adhemerval Zanella Netto Signed-off-by: Alejandro Colomar --- Makeconfig | 617 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 456 insertions(+), 161 deletions(-) diff --git a/Makeconfig b/Makeconfig index cead59d915..7f1e6f11ec 100644 --- a/Makeconfig +++ b/Makeconfig @@ -78,7 +78,9 @@ sysdirs := $(foreach D,$(config-sysdirs),$(firstword $(filter /%,$D) $(..)$D)) +sysdep_dirs = $(sysdirs) ifdef objdir -+sysdep_dirs := $(objdir) $(+sysdep_dirs) ++sysdep_dirs := \ + $(objdir) \ + $(+sysdep_dirs) endif # Run config.status to update config.make and config.h. We don't show the @@ -341,9 +343,13 @@ endif # Default flags to pass the C compiler. ifndef default_cflags ifeq ($(release),stable) -default_cflags := -g -O2 +default_cflags := \ + -g \ + -O2 else -default_cflags := -g -O +default_cflags := \ + -g \ + -O endif endif @@ -429,20 +435,34 @@ link-extra-libs-tests = $(libsupport) # Command for linking PIE programs with the C library. ifndef +link-pie -+link-pie-before-inputs = $(if $($(@F)-no-pie),$(no-pie-ldflag),-pie) \ - $(if $($(@F)-no-dt-relr),$(no-dt-relr-ldflag),$(dt-relr-ldflag)) \ - -Wl,-O1 -nostdlib -nostartfiles \ - $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \ - $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \ - $(firstword $(CRT-$(@F)) $(csu-objpfx)S$(start-installed-name)) \ - $(+preinit) $(+prectorS) -+link-pie-before-libc = -o $@ $(+link-pie-before-inputs) \ - $(filter-out $(addprefix $(csu-objpfx),start.o \ - S$(start-installed-name)) \ - $(+preinit) $(link-extra-libs) \ - $(common-objpfx)libc% $(+postinit),$^) \ - $(link-extra-libs) -+link-pie-after-libc = $(+postctorS) $(+postinit) ++link-pie-before-inputs = \ + $(if $($(@F)-no-pie),$(no-pie-ldflag),-pie) \ + $(if $($(@F)-no-dt-relr),$(no-dt-relr-ldflag),$(dt-relr-ldflag)) \ + -Wl,-O1 \ + -nostdlib \ + -nostartfiles \ + $(sysdep-LDFLAGS) \ + $(LDFLAGS) \ + $(LDFLAGS-$(@F)) \ + $(relro-LDFLAGS) \ + $(hashstyle-LDFLAGS) \ + $(firstword $(CRT-$(@F)) $(csu-objpfx)S$(start-installed-name)) \ + $(+preinit) \ + $(+prectorS) ++link-pie-before-libc = \ + -o $@ \ + $(+link-pie-before-inputs) \ + $(filter-out \ + $(addprefix $(csu-objpfx),start.o S$(start-installed-name)) \ + $(+preinit) \ + $(link-extra-libs) \ + $(common-objpfx)libc% \ + $(+postinit), \ + $^) \ + $(link-extra-libs) ++link-pie-after-libc = \ + $(+postctorS) \ + $(+postinit) define +link-pie $(CC) $(link-libc-rpath-link) $(+link-pie-before-libc) $(rtld-LDFLAGS) \ $(link-extra-flags) $(link-libc) $(+link-pie-after-libc) @@ -461,19 +481,32 @@ endef endif # Command for statically linking programs with the C library. ifndef +link-static -+link-static-before-inputs = -nostdlib -nostartfiles -static \ - $(if $($(@F)-no-pie),$(no-pie-ldflag),$(static-pie-ldflag)) \ - $(if $($(@F)-no-dt-relr),$(no-dt-relr-ldflag),$(static-pie-dt-relr-ldflag)) \ - $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \ - $(firstword $(CRT-$(@F)) $(csu-objpfx)$(real-static-start-installed-name)) \ - $(+preinit) $(+prectorT) -+link-static-before-libc = -o $@ $(+link-static-before-inputs) \ - $(filter-out $(addprefix $(csu-objpfx),start.o \ - $(start-installed-name)) \ - $(+preinit) $(link-extra-libs-static) \ - $(common-objpfx)libc% $(+postinit),$^) \ - $(link-extra-libs-static) -+link-static-after-libc = $(+postctorT) $(+postinit) ++link-static-before-inputs = \ + -nostdlib \ + -nostartfiles \ + -static \ + $(if $($(@F)-no-pie),$(no-pie-ldflag),$(static-pie-ldflag)) \ + $(if $($(@F)-no-dt-relr),$(no-dt-relr-ldflag),$(static-pie-dt-relr-ldflag)) \ + $(sysdep-LDFLAGS) \ + $(LDFLAGS) \ + $(LDFLAGS-$(@F)) \ + $(firstword $(CRT-$(@F)) $(csu-objpfx)$(real-static-start-installed-name)) \ + $(+preinit) \ + $(+prectorT) ++link-static-before-libc = \ + -o $@ \ + $(+link-static-before-inputs) \ + $(filter-out \ + $(addprefix $(csu-objpfx),start.o $(start-installed-name)) \ + $(+preinit) \ + $(link-extra-libs-static) \ + $(common-objpfx)libc% \ + $(+postinit), \ + $^) \ + $(link-extra-libs-static) ++link-static-after-libc = \ + $(+postctorT) \ + $(+postinit) define +link-static $(CC) $(+link-static-before-libc) $(link-extra-flags) $(link-libc-static) \ $(+link-static-after-libc) @@ -494,29 +527,51 @@ endif ifeq (yes,$(build-pie-default)) +link = $(+link-pie) +link-tests = $(+link-pie-tests) -+link-tests-before-inputs = $(+link-pie-before-inputs) $(rtld-tests-LDFLAGS) -+link-tests-after-inputs = $(link-libc-tests) $(+link-pie-after-libc) ++link-tests-before-inputs = \ + $(+link-pie-before-inputs) \ + $(rtld-tests-LDFLAGS) ++link-tests-after-inputs = \ + $(link-libc-tests) \ + $(+link-pie-after-libc) +link-printers-tests = $(+link-pie-printers-tests) else # not build-pie-default -+link-before-inputs = -nostdlib -nostartfiles $(no-pie-ldflag) \ - $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \ - $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \ - $(firstword $(CRT-$(@F)) $(csu-objpfx)$(start-installed-name)) \ - $(+preinit) $(+prector) -+link-before-libc = -o $@ $(+link-before-inputs) \ - $(filter-out $(addprefix $(csu-objpfx),start.o \ - $(start-installed-name)) \ - $(+preinit) $(link-extra-libs) \ - $(common-objpfx)libc% $(+postinit),$^) \ - $(link-extra-libs) -+link-after-libc = $(+postctor) $(+postinit) ++link-before-inputs = \ + -nostdlib \ + -nostartfiles \ + $(no-pie-ldflag) \ + $(sysdep-LDFLAGS) \ + $(LDFLAGS) \ + $(LDFLAGS-$(@F)) \ + $(relro-LDFLAGS) \ + $(hashstyle-LDFLAGS) \ + $(firstword $(CRT-$(@F)) $(csu-objpfx)$(start-installed-name)) \ + $(+preinit) \ + $(+prector) ++link-before-libc = \ + -o $@ \ + $(+link-before-inputs) \ + $(filter-out \ + $(addprefix $(csu-objpfx),start.o $(start-installed-name)) \ + $(+preinit) \ + $(link-extra-libs) \ + $(common-objpfx)libc% \ + $(+postinit), \ + $^) \ + $(link-extra-libs) ++link-after-libc = \ + $(+postctor) \ + $(+postinit) define +link $(CC) $(link-libc-rpath-link) $(+link-before-libc) $(rtld-LDFLAGS) \ $(link-extra-flags) $(link-libc) $(+link-after-libc) $(call after-link,$@) endef -+link-tests-before-inputs = $(+link-before-inputs) $(rtld-tests-LDFLAGS) -+link-tests-after-inputs = $(link-libc-tests) $(+link-after-libc) ++link-tests-before-inputs = \ + $(+link-before-inputs) \ + $(rtld-tests-LDFLAGS) ++link-tests-after-inputs = \ + $(link-libc-tests) \ + $(+link-after-libc) define +link-tests $(CC) $(+link-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \ $(+link-after-libc) @@ -532,7 +587,9 @@ else # build-static +link = $(+link-static) +link-tests = $(+link-static-tests) +link-tests-before-inputs = $(+link-static-before-inputs) -+link-tests-after-inputs = $(link-libc-static-tests) $(+link-static-after-libc) ++link-tests-after-inputs = \ + $(link-libc-static-tests) \ + $(+link-static-after-libc) +link-printers-tests = $(+link-static-tests) endif # build-shared endif # +link @@ -549,7 +606,11 @@ endif # +link # when compiling the tests, which will throw an error if some special macros # (such as __OPTIMIZE__ and IS_IN_build) aren't defined. To avoid this, we # tell gcc to define IS_IN_build. -CFLAGS-printers-tests := -O0 -ggdb3 -DIS_IN_build $(no-fortify-source) +CFLAGS-printers-tests := \ + -O0 \ + -ggdb3 \ + -DIS_IN_build \ + $(no-fortify-source) ifeq (yes,$(build-shared)) # These indicate whether to link using the built ld.so or the installed one. @@ -595,26 +656,55 @@ link-libc-tests-rpath-link = $(link-libc-rpath-link) link-test-modules-rpath-link = endif # build-hardcoded-path-in-tests -link-libc-between-gnulib = $(common-objpfx)libc.so$(libc.so-version) \ - $(common-objpfx)$(patsubst %,$(libtype.oS),c) \ - -Wl,--as-needed $(elf-objpfx)ld.so \ - -Wl,--no-as-needed -link-libc = $(link-libc-between-gnulib) $(gnulib) +link-libc-between-gnulib = \ + $(common-objpfx)libc.so$(libc.so-version) \ + $(common-objpfx)$(patsubst %,$(libtype.oS),c) \ + -Wl,--as-needed \ + $(elf-objpfx)ld.so \ + -Wl,--no-as-needed +link-libc = \ + $(link-libc-between-gnulib) \ + $(gnulib) -link-libc-tests-after-rpath-link = $(gnulib-tests) $(link-libc-between-gnulib) $(gnulib-tests) -link-libc-tests = $(link-libc-tests-rpath-link) \ - $(link-libc-tests-after-rpath-link) +link-libc-tests-after-rpath-link = \ + $(gnulib-tests) \ + $(link-libc-between-gnulib) \ + $(gnulib-tests) +link-libc-tests = \ + $(link-libc-tests-rpath-link) \ + $(link-libc-tests-after-rpath-link) # Pretty printer test programs always require rpath instead of rpath-link. -link-libc-printers-tests = $(link-libc-rpath) \ - $(link-libc-tests-after-rpath-link) +link-libc-printers-tests = \ + $(link-libc-rpath) \ + $(link-libc-tests-after-rpath-link) # This is how to find at build-time things that will be installed there. -rpath-dirs = math elf dlfcn nss nis rt resolv mathvec support +rpath-dirs = \ + math \ + elf \ + dlfcn \ + nss \ + nis \ + rt \ + resolv \ + mathvec \ + support rpath-link = \ -$(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%))) + $(common-objdir):$(subst $(empty) ,:, \ + $(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%))) else # build-static -link-libc = $(common-objpfx)libc.a $(otherlibs) $(gnulib) $(common-objpfx)libc.a $(gnulib) -link-libc-tests = $(common-objpfx)libc.a $(otherlibs) $(gnulib-tests) $(common-objpfx)libc.a $(gnulib-tests) +link-libc = \ + $(common-objpfx)libc.a \ + $(otherlibs) \ + $(gnulib) \ + $(common-objpfx)libc.a \ + $(gnulib) +link-libc-tests = \ + $(common-objpfx)libc.a \ + $(otherlibs) \ + $(gnulib-tests) \ + $(common-objpfx)libc.a \ + $(gnulib-tests) endif # build-shared endif # link-libc @@ -638,8 +728,16 @@ link-extra-libs-static = $(link-extra-libs) endif # The static libraries. -link-libc-static = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib) -Wl,--end-group -link-libc-static-tests = -Wl,--start-group $(common-objpfx)libc.a $(static-gnulib-tests) -Wl,--end-group +link-libc-static = \ + -Wl,--start-group \ + $(common-objpfx)libc.a \ + $(static-gnulib) \ + -Wl,--end-group +link-libc-static-tests = \ + -Wl,--start-group \ + $(common-objpfx)libc.a \ + $(static-gnulib-tests) \ + -Wl,--end-group # How to link against libgcc. Some libgcc functions, such as those # for "long long" arithmetic or software floating point, can always be @@ -681,20 +779,36 @@ ifneq ($(have-cc-with-libunwind),yes) else libunwind = -lunwind endif -libgcc_eh := -Wl,--as-needed -lgcc_s $(libunwind) -Wl,--no-as-needed +libgcc_eh := \ + -Wl,--as-needed \ + -lgcc_s \ + $(libunwind) \ + -Wl,--no-as-needed gnulib-arch = -gnulib = -lgcc $(gnulib-arch) -gnulib-tests := -lgcc $(libgcc_eh) +gnulib = \ + -lgcc \ + $(gnulib-arch) +gnulib-tests := \ + -lgcc \ + $(libgcc_eh) static-gnulib-arch = # By default, elf/static-stubs.o, instead of -lgcc_eh, is used to # statically link programs. When --disable-shared is used, we use # -lgcc_eh since elf/static-stubs.o isn't sufficient. ifeq (yes,$(build-shared)) -static-gnulib = -lgcc $(static-gnulib-arch) +static-gnulib = \ + -lgcc \ + $(static-gnulib-arch) else -static-gnulib = -lgcc -lgcc_eh $(static-gnulib-arch) +static-gnulib = \ + -lgcc \ + -lgcc_eh \ + $(static-gnulib-arch) endif -static-gnulib-tests := -lgcc -lgcc_eh $(libunwind) +static-gnulib-tests := \ + -lgcc \ + -lgcc_eh \ + $(libunwind) libc.so-gnulib := -lgcc endif +preinit = $(addprefix $(csu-objpfx),crti.o) @@ -725,12 +839,17 @@ endif # Likewise, but the name of the program is preceded by # = assignments for environment variables. ifndef test-wrapper-env -test-wrapper-env = $(test-wrapper) env +test-wrapper-env = \ + $(test-wrapper) \ + env endif # Likewise, but the program's environment will be empty except for any # explicit = assignments preceding the program name. ifndef test-wrapper-env-only -test-wrapper-env-only = $(test-wrapper) env -i +test-wrapper-env-only = \ + $(test-wrapper) \ + env \ + -i endif # Whether to run test programs built for the library's host system. @@ -751,15 +870,17 @@ endif # How to run a program we just linked with our library. # The program binary is assumed to be $(word 2,$^). built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^)) -rtld-prefix = $(elf-objpfx)$(rtld-installed-name) \ - --library-path \ - $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) +rtld-prefix = \ + $(elf-objpfx)$(rtld-installed-name) \ + --library-path \ + $(rpath-link)$(patsubst %, :%, $(sysdep-library-path)) ifeq (yes,$(build-shared)) comma = , sysdep-library-path = \ -$(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %, \ - $(filter -Wl$(comma)-rpath-link=%, \ - $(sysdep-LDFLAGS))))) + $(subst $(empty) ,:, \ + $(strip $(patsubst \ + -Wl$(comma)-rpath-link=%, %, \ + $(filter -Wl$(comma)-rpath-link=%, $(sysdep-LDFLAGS))))) # $(run-via-rtld-prefix) is a command that, when prepended to the name # of a program built with the newly built library, produces a command # that, executed on the host for which the library is built, runs that @@ -773,8 +894,10 @@ run-via-rtld-prefix = endif # $(run-program-env) is the default environment variable settings to # use when running a program built with the newly built library. -run-program-env = GCONV_PATH=$(common-objpfx)iconvdata \ - LOCPATH=$(common-objpfx)localedata LC_ALL=C +run-program-env = \ + GCONV_PATH=$(common-objpfx)iconvdata \ + LOCPATH=$(common-objpfx)localedata \ + LC_ALL=C # $(run-program-prefix) is a command that, when prepended to the name # of a program built with the newly built library, produces a command # that, executed on the build system on which "make" is run, runs that @@ -783,8 +906,10 @@ run-program-env = GCONV_PATH=$(common-objpfx)iconvdata \ # before and after a list of environment variables. run-program-prefix-before-env = $(test-wrapper-env) run-program-prefix-after-env = $(run-via-rtld-prefix) -run-program-prefix = $(run-program-prefix-before-env) $(run-program-env) \ - $(run-program-prefix-after-env) +run-program-prefix = \ + $(run-program-prefix-before-env) \ + $(run-program-env) \ + $(run-program-prefix-after-env) # $(built-program-cmd) is a command that, executed on the build system # on which "make" is run, runs the newly built program that is the # second dependency of the makefile target in which @@ -792,14 +917,20 @@ run-program-prefix = $(run-program-prefix-before-env) $(run-program-env) \ # $(built-program-cmd-after-env) are similar, before and after a list # of environment variables. built-program-cmd-before-env = $(test-wrapper-env) -built-program-cmd-after-env = $(run-via-rtld-prefix) $(built-program-file) -built-program-cmd = $(built-program-cmd-before-env) $(run-program-env) \ - $(built-program-cmd-after-env) +built-program-cmd-after-env = \ + $(run-via-rtld-prefix) \ + $(built-program-file) +built-program-cmd = \ + $(built-program-cmd-before-env) \ + $(run-program-env) \ + $(built-program-cmd-after-env) # $(host-built-program-cmd) is a command that, executed on the host # for which the library is built, runs the newly built program that is # the second dependency of the makefile target in which # $(host-built-program-cmd) is used. -host-built-program-cmd = $(run-via-rtld-prefix) $(built-program-file) +host-built-program-cmd = \ + $(run-via-rtld-prefix) \ + $(built-program-file) # $(ld-library-path) is the common content to be set in LD_LIBRARY_PATH # for running static binaries that may load dynamic objects. ld-library-path = $(objpfx):$(common-objpfx)$(addprefix :,$(sysdep-ld-library-path)) @@ -838,12 +969,16 @@ ifeq (yes,$(build-hardcoded-path-in-tests)) test-via-rtld-prefix = test-program-prefix-before-env = $(test-wrapper-env) test-program-prefix-after-env = -test-program-prefix = $(test-program-prefix-before-env) $(run-program-env) \ - $(test-program-prefix-after-env) +test-program-prefix = \ + $(test-program-prefix-before-env) \ + $(run-program-env) \ + $(test-program-prefix-after-env) test-program-cmd-before-env = $(test-wrapper-env) test-program-cmd-after-env = $(built-program-file) -test-program-cmd = $(test-program-cmd-before-env) $(run-program-env) \ - $(test-program-cmd-after-env) +test-program-cmd = \ + $(test-program-cmd-before-env) \ + $(run-program-env) \ + $(test-program-cmd-after-env) host-test-program-cmd = $(built-program-file) else test-via-rtld-prefix = $(run-via-rtld-prefix) @@ -858,15 +993,32 @@ endif # Extra flags to pass to GCC. ifeq ($(all-warnings),yes) -+gccwarn := -Wall -Wwrite-strings -Wcast-qual -Wbad-function-cast -Wmissing-noreturn -Wmissing-prototypes -Wmissing-declarations -Wcomment -Wcomments -Wtrigraphs -Wsign-compare -Wfloat-equal -Wmultichar ++gccwarn := \ + -Wall \ + -Wwrite-strings \ + -Wcast-qual \ + -Wbad-function-cast \ + -Wmissing-noreturn \ + -Wmissing-prototypes \ + -Wmissing-declarations \ + -Wcomment \ + -Wcomments \ + -Wtrigraphs \ + -Wsign-compare \ + -Wfloat-equal \ + -Wmultichar else -+gccwarn := -Wall -Wwrite-strings ++gccwarn := \ + -Wall \ + -Wwrite-strings endif +gccwarn += -Wundef ifeq ($(enable-werror),yes) +gccwarn += -Werror endif -+gccwarn-c = -Wstrict-prototypes -Wold-style-definition ++gccwarn-c = \ + -Wstrict-prototypes \ + -Wold-style-definition # We do not depend on the address of constants in different files to be # actually different, so allow the compiler to merge them all. @@ -883,11 +1035,23 @@ endif +extra-math-flags = $(if $(filter libm,$(in-module)),-fno-math-errno,-fmath-errno) # Use 64 bit time_t support for installed programs -installed-modules = nonlib nscd ldconfig locale_programs \ - iconvprogs libnss_files libnss_compat libnss_db libnss_hesiod \ - libutil libpcprofile libnsl -+extra-time-flags = $(if $(filter $(installed-modules), \ - $(in-module)),-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64) +installed-modules = \ + nonlib \ + nscd \ + ldconfig \ + locale_programs \ + iconvprogs \ + libnss_files \ + libnss_compat \ + libnss_db \ + libnss_hesiod \ + libutil \ + libpcprofile \ + libnsl ++extra-time-flags = \ + $(if $(filter $(installed-modules), $(in-module)), \ + -D_TIME_BITS=64 \ + -D_FILE_OFFSET_BITS=64) # We might want to compile with some stack-protection flag. ifneq ($(stack-protector),) @@ -968,8 +1132,13 @@ endif # $(+cflags) == "" # and other constructs do not work for common symbols (and would # otherwise require specifying __attribute__ ((nocommon)) on a # case-by-case basis). -+cflags += $(cflags-cpu) $(+gccwarn) $(+merge-constants) $(+math-flags) \ - $(+stack-protector) -fno-common ++cflags += \ + $(cflags-cpu) \ + $(+gccwarn) \ + $(+merge-constants) \ + $(+math-flags) \ + $(+stack-protector) \ + -fno-common +gcc-nowarn := -w # We must filter out elf because the early bootstrap of the dynamic loader @@ -996,19 +1165,37 @@ endif # include files (including ones given in angle brackets) in the parent # library source directory, in the include directory, and in the # current directory. -+includes = -I$(..)include $(if $(subdir),$(objpfx:%/=-I%)) \ - $(+sysdep-includes) $(includes) \ - $(patsubst %/,-I%,$(..)) $(libio-include) -I. $(sysincludes) ++includes = \ + -I$(..)include \ + $(if $(subdir),$(objpfx:%/=-I%)) \ + $(+sysdep-includes) \ + $(includes) \ + $(patsubst %/,-I%,$(..)) \ + $(libio-include) \ + -I. \ + $(sysincludes) # Since libio has several internal header files, we use a -I instead # of many little headers in the include directory. libio-include = -I$(..)libio # List of non-library modules that we build. -built-modules = iconvprogs iconvdata ldconfig libmemusage \ - libpcprofile librpcsvc locale-programs \ - memusagestat nonlib nscd extramodules libnldbl libsupport \ - testsuite testsuite-internal +built-modules = \ + iconvprogs \ + iconvdata \ + ldconfig \ + libmemusage \ + libpcprofile \ + librpcsvc \ + locale-programs \ + memusagestat \ + nonlib \ + nscd \ + extramodules \ + libnldbl \ + libsupport \ + testsuite \ + testsuite-internal in-module = $(subst -,_,$(firstword $(libof-$(basename $(@F))) \ $(libof-$( $(common-objpfx)$(test-name).test-result +evaluate-test = \ + $(..)scripts/evaluate-test.sh \ + $(test-name) \ + $$? \ + $(if $(test-xfail-$(test-xfail-name)),true,false) \ + $(if $(stop-on-test-failure),true,false) \ + > $(common-objpfx)$(test-name).test-result endif # Makeconfig not yet included