Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201019224342.53303-2-joao.moreira@intel.com>
Date: Mon, 19 Oct 2020 15:43:39 -0700
From: Joao Moreira <joao.moreira@...el.com>
To: musl@...ts.openwall.com
Subject: [PATCH 1/4] Support ASFLAGS in configure and Makefile

Currently MUSL does not support setting ASFLAGS (assembler flags) through
configure. Thus, add support to ASFLAGS, which are passed similarly as CFLAGS.

Signed-off-by: Joao Moreira <joao.moreira@...el.com>
---
 Makefile  | 4 ++--
 configure | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index e8cc4436..f75a946d 100644
--- a/Makefile
+++ b/Makefile
@@ -135,9 +135,9 @@ CC_CMD = $(CC) $(CFLAGS_ALL) -c -o $@ $<
 
 # Choose invocation of assembler to be used
 ifeq ($(ADD_CFI),yes)
-	AS_CMD = LC_ALL=C awk -f $(srcdir)/tools/add-cfi.common.awk -f $(srcdir)/tools/add-cfi.$(ARCH).awk $< | $(CC) $(CFLAGS_ALL) -x assembler -c -o $@ -
+	AS_CMD = LC_ALL=C awk -f $(srcdir)/tools/add-cfi.common.awk -f $(srcdir)/tools/add-cfi.$(ARCH).awk $< | $(CC) $(CFLAGS_ALL) $(ASFLAGS) -x assembler -c -o $@ -
 else
-	AS_CMD = $(CC_CMD)
+	AS_CMD = $(CC_CMD) $(ASFLAGS)
 endif
 
 obj/%.o: $(srcdir)/%.s
diff --git a/configure b/configure
index 947adf41..4ad78b27 100755
--- a/configure
+++ b/configure
@@ -41,6 +41,7 @@ Optional packages:
 Some influential environment variables:
   CC                      C compiler command [detected]
   CFLAGS                  C compiler flags [-Os -pipe ...]
+  ASFLAGS                 Assembler flags [none]
   CROSS_COMPILE           prefix for cross compiler and tools [none]
   LIBCC                   compiler runtime library [detected]
 
@@ -181,6 +182,7 @@ AR=*) AR=${arg#*=} ;;
 RANLIB=*) RANLIB=${arg#*=} ;;
 CC=*) CC=${arg#*=} ;;
 CFLAGS=*) CFLAGS=${arg#*=} ;;
+ASFLAGS=*) ASFLAGS=${arg#*=} ;;
 CPPFLAGS=*) CPPFLAGS=${arg#*=} ;;
 LDFLAGS=*) LDFLAGS=${arg#*=} ;;
 CROSS_COMPILE=*) CROSS_COMPILE=${arg#*=} ;;
@@ -787,6 +789,7 @@ includedir = $includedir
 syslibdir = $syslibdir
 CC = $CC
 CFLAGS = $CFLAGS
+ASFLAGS = $ASFLAGS
 CFLAGS_AUTO = $CFLAGS_AUTO
 CFLAGS_C99FSE = $CFLAGS_C99FSE
 CFLAGS_MEMOPS = $CFLAGS_MEMOPS
-- 
2.27.0

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.