From 061d3ec62707a526a83482e57d202a66f9d776cd Mon Sep 17 00:00:00 2001 From: Ismael Luceno Date: Tue, 23 Aug 2022 19:34:39 +0200 Subject: [PATCH] Test the -m32 and -m64 compiler flags before use Fixes: https://github.com/haampie/libtree/issues/78 Signed-off-by: Ismael Luceno --- tests/05_32_bits/Makefile | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/05_32_bits/Makefile b/tests/05_32_bits/Makefile index 2c0bece..5628f42 100644 --- a/tests/05_32_bits/Makefile +++ b/tests/05_32_bits/Makefile @@ -3,7 +3,7 @@ LD_LIBRARY_PATH= -.PHONY: clean +.PHONY: clean check all: check @@ -21,11 +21,21 @@ exe64: lib64/libx.so exe32: lib32/libx.so echo 'extern int a(); int _start(){return a();}' | $(CC) -m32 "-Wl,-rpath,$(CURDIR)/lib64" "-Wl,-rpath,$(CURDIR)/lib32" -o $@ -nostdlib -x c - -Llib32 -lx -check: exe32 exe64 - ../../libtree exe32 - ../../libtree exe64 - clean: rm -rf lib32 lib64 exe* CURDIR ?= $(.CURDIR) + +test-flag = 2>/dev/null ${CC} -E /dev/null +test-end = && echo y || echo n +support-m32 != ${test-flag} -m32 ${test-end} +support-m64 != ${test-flag} -m64 ${test-end} + +check${support-m32:y=}:: exe32 + ../../libtree exe32 + +check${support-m64:y=}:: exe64 + ../../libtree exe64 + +check${support-m32:n=} check${support-m64:n=}:: + @echo WARNING: test skipped at ${CURDIR} a href='/guix/diff/nix/libutil/util.cc?id=3485984a090edd5b1721a69a389a2e44077354e7'>diff
AgeCommit message (Expand)Author
2021-11-19daemon: Micro-optimize 'deletePath'....'remove' calls 'unlink' first and falls back to 'rmdir' upon EISDIR. This change gets rid of the 'unlink' call for every directory being removed. * nix/libutil/util.cc (_deletePath): Call 'unlink' or 'rmdir' depending on 'st.st_mode', rather than call 'remove'. Ludovic Courtès
2020-12-08daemon: 'Agent' constructor takes a list of environment variables....* nix/libutil/util.hh (struct Agent)[Agent]: Add 'env' parameter. * nix/libutil/util.cc (Agent::Agent): Honor it. Ludovic Courtès
2020-09-14daemon: Move 'Agent' to libutil....* nix/libstore/build.cc (DerivationGoal::tryBuildHook): Add "offload" to 'args' and pass settings.guixProgram as the first argument to Agent::Agent. (pathNullDevice, commonChildInit, Agent, Agent::Agent) (Agent::~Agent): Move to... * nix/libutil/util.cc: ... here. * nix/libutil/util.hh (struct Agent, commonChildInit): New declarations. Ludovic Courtès