From e3b9e3d04b8391ef39df40f190ef8b9d689c9f13 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 31 Mar 2009 07:01:06 +0100 Subject: [build] Add --divide to ASFLAGS if supported by the assembler Some builds of the GNU assembler will treat a '/' character as a comment delimiter. Adding "--divide" will cause it to be treated as a division operator, as we expect. The "--divide" option is not available in all gas versions, so apply it only conditionally. Suggested-by: Joshua Oreman --- src/Makefile.housekeeping | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Makefile.housekeeping') diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index 71592db8..be36b36b 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -126,6 +126,14 @@ SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector') CFLAGS += $(SP_FLAGS) endif +# Some versions of gas choke on division operators, treating them as +# comment markers. Specifying --divide will work around this problem, +# but isn't available on older gas versions. +# +DIVIDE_TEST = $(AS) --divide /dev/null -o /dev/null 2>/dev/null +DIVIDE_FLAGS := $(shell $(DIVIDE_TEST) && $(ECHO) '--divide') +ASFLAGS += $(DIVIDE_FLAGS) + ############################################################################### # # Build verbosity -- cgit v1.2.3-55-g7522