Quellcode durchsuchen

[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 <oremanj@rwcr.net>
tags/v0.9.8
Michael Brown vor 15 Jahren
Ursprung
Commit
e3b9e3d04b
1 geänderte Dateien mit 8 neuen und 0 gelöschten Zeilen
  1. 8
    0
      src/Makefile.housekeeping

+ 8
- 0
src/Makefile.housekeeping Datei anzeigen

@@ -126,6 +126,14 @@ SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
126 126
 CFLAGS	+= $(SP_FLAGS)
127 127
 endif
128 128
 
129
+# Some versions of gas choke on division operators, treating them as
130
+# comment markers.  Specifying --divide will work around this problem,
131
+# but isn't available on older gas versions.
132
+#
133
+DIVIDE_TEST = $(AS) --divide /dev/null -o /dev/null 2>/dev/null
134
+DIVIDE_FLAGS := $(shell $(DIVIDE_TEST) && $(ECHO) '--divide')
135
+ASFLAGS	+= $(DIVIDE_FLAGS)
136
+
129 137
 ###############################################################################
130 138
 #
131 139
 # Build verbosity

Laden…
Abbrechen
Speichern