blob: 1d5d9c12ab0531eca6e18d3f4c13628ddf7c3cda [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From b27c253bfb78fa3c5f416e6caee101098a4b58cc Mon Sep 17 00:00:00 2001
Brad Bishop6e60e8b2018-02-01 10:27:11 -05002From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 12 Jul 2017 18:09:46 -0700
Brad Bishop316dfdd2018-06-25 12:45:53 -04004Subject: [PATCH] build: Adjust CFLAGS/LDFLAGS to append values passed from env
Brad Bishop6e60e8b2018-02-01 10:27:11 -05005
6For musl we have to pass additional arguments via cflags and ldflags
7to link in librirpc, make room for those changes to take effect
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
Brad Bishop316dfdd2018-06-25 12:45:53 -040010
Brad Bishop6e60e8b2018-02-01 10:27:11 -050011---
12 scripts/build | 2 +-
13 src/Makefile | 14 +++++++-------
14 2 files changed, 8 insertions(+), 8 deletions(-)
15
16diff --git a/scripts/build b/scripts/build
17index 34a1371..3786741 100755
18--- a/scripts/build
19+++ b/scripts/build
20@@ -18,7 +18,7 @@ done
21
22 trap 'rm -f ${BASE}$$.s ${BASE}$$.c ${BASE}$$.o ${BASE}$$; exit 1' 1 2 15
23
24-LDLIBS=-lm
Andrew Geissler72956ed2021-01-08 16:11:14 -060025+LDLIBS="$LDLIBS -lm"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050026
27 # check for HP-UX's ANSI compiler
28 echo "main(int ac, char *av[]) { int i; }" > ${BASE}$$.c
29diff --git a/src/Makefile b/src/Makefile
30index d9efd54..96467d7 100644
31--- a/src/Makefile
32+++ b/src/Makefile
33@@ -112,8 +112,8 @@ LIBOBJS= $O/lib_tcp.o $O/lib_udp.o $O/lib_unix.o $O/lib_timing.o \
34 $O/lib_sched.o
35
36 lmbench: $(UTILS)
37- @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all
38- -@env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="k$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt
39+ @env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all
40+ -@env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="k$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt
41
42 results: lmbench
43 @env OS="${OS}" ../scripts/config-run
44@@ -137,7 +137,7 @@ os: lmbench
45 @env OS="${OS}" BENCHMARK_HARDWARE=NO BENCHMARK_OS=YES ../scripts/results
46
47 install: lmbench
48- @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build install-target
49+ @env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build install-target
50
51 install-target:
52 if [ ! -d $(BASE) ]; then mkdir $(BASE); fi
53@@ -155,16 +155,16 @@ all: $(EXES) $O/lmbench
54 opt: $(OPT_EXES)
55 asm: $(ASMS)
56 $(ASMS):
57- $(CC) -S $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ `basename $@ .s`.c
58+ $(CC) -S $(CFLAGS) $(CPPFLAGS) -o $@ `basename $@ .s`.c $(LDFLAGS)
59
60 Wall:
61- @env CFLAGS="-g -O -Wall" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt
62+ @env CFLAGS+="-g -O -Wall" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt
63
64 debug:
65- @env CFLAGS="-g -O -DDEBUG" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt
66+ @env CFLAGS+="-g -O -DDEBUG" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt
67
68 assembler:
69- @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build asm
70+ @env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build asm
71
72
73 tag: