diff options
author | KJ Tsanaktsidis <[email protected]> | 2024-07-06 14:47:02 +1000 |
---|---|---|
committer | KJ Tsanaktsidis <[email protected]> | 2024-07-07 20:14:44 +1000 |
commit | b18701a7ae0a71c339906ef0db4910fb43645b45 () | |
tree | e1d7f8859f0f0fdbc8a3c186c935e8dde27b584a | |
parent | 087b461c8311886f8a9511930a065ef9fd6b57ce (diff) |
Remove $(ASFLAGS) from build system and assemble with $(CFLAGS) instead
We already assemble our assembly files using the $(CC) compiler driver, rather than the actual $(AS) assembler. This means that * The C preprocessor gets run on the assembly file * It's valid to pass gcc-style flags to it, like e.g. -mbranch-protection or -fcf-protection * If you do so, the relevant preprocessor macros like __CET__ get set * If you really wanted to pass assembler flags, you would need to do that using -Wa,... anyway So I think it makes sense to pass "$(XCFLAGS) $(CFLAGS) $(CPPFLAGS)" to gcc/clang/etc when assembling, rather than passing $(ASFLAGS) (since the flags are not actually passed to `as`, but `cc`!). The side effect of this is that if there are mitigation flags like -fcf-protection in $CFLAGS, then the relevant macros like __CET__ will be defined when assembling the files. [Bug #20601]
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | template/Makefile.in | 3 |
2 files changed, 1 insertions, 3 deletions
@@ -489,7 +489,6 @@ AC_CACHE_CHECK([for $AR flags], [rb_cv_arflags], [ [rb_cv_arflags=rcD], [rb_cv_arflags=rcu]) ]) AC_SUBST(ARFLAGS, ["$rb_cv_arflags "]) -AC_SUBST(ASFLAGS) AS_CASE(["$target_os"], [cygwin*|msys*|mingw*], [ @@ -225,7 +225,6 @@ AR = @AR@ ARFLAGS = @ARFLAGS@$(empty) RANLIB = @RANLIB@ AS = @AS@ -ASFLAGS = @ASFLAGS@ $(ARCH_FLAG) $(INCFLAGS) IFCHANGE = $(SHELL) $(tooldir)/ifchange OBJDUMP = @OBJDUMP@ OBJCOPY = @OBJCOPY@ @@ -449,7 +448,7 @@ $(srcdir)/enc/jis/props.h: enc/jis/props.kwd .$(ASMEXT).$(OBJEXT): @$(ECHO) assembling $< - $(Q) $(CC) $(ASFLAGS) -DSYMBOL_PREFIX=$(SYMBOL_PREFIX) -o $@ -c $< .c.$(ASMEXT): @$(ECHO) translating $< |