Open Bug 1654031 Opened 4 years ago Updated 4 years ago

xpcom/reflect/xptcall/md/unix fails with x86_64-pc-linux-gnu-as: invalid option -- 'N' when AS is set

Categories

(Core :: XPCOM, defect, P5)

78 Branch
defect

Tracking

()

People

(Reporter: whissi, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0

Steps to reproduce:

When you set AS environment variable to specify used assembler, build will fail in

 0:48.09 gmake[4]: Entering directory '/var/tmp/portage/www-client/firefox-78.0.2/work/firefox-78.0.2/ff/xpcom/reflect/xptcall/md/unix'
 0:48.09 xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.o
 0:48.09 /usr/bin/x86_64-pc-linux-gnu-as -o xptcinvoke_asm_x86_64_unix.o -DNDEBUG=1 -DTRIMMED=1 -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -fPIC -Wa,--noexecstack -include /var/tmp/portage/www-client/firefox-78.0.2/work/firefox-78.0.2/ff/mozilla-config.h -DMOZILLA_CLIENT -I/var/tmp/portage/www-client/firefox-78.0.2/work/firefox-78.0.2/xpcom/reflect/xptcall  -c /var/tmp/portage/www-client/firefox-78.0.2/work/firefox-78.0.2/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S
 0:48.09 /usr/bin/x86_64-pc-linux-gnu-as: invalid option -- 'N'
 0:48.09 gmake[4]: *** [/var/tmp/portage/www-client/firefox-78.0.2/work/firefox-78.0.2/config/rules.mk:743: xptcinvoke_asm_x86_64_unix.o] Error 1

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → XPCOM
Product: Firefox → Core

I'm inclined to say this is not actually a bug; if you set AS to something that's not CC on Unix, I think you're going to have problems no matter what.

You are using AS variable in non-standard way.
Normally AS variable references assembler itself, not C compiler used for assembling.
You should use CCAS variable for C compiler used for assembling (and CCASFLAGS for options passed thereto).
(Or you could use CXXAS and CXXASFLAGS, if you need C++ compiler for assembling.)

See:
https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html ("Assembling and preprocessing assembler programs" section)
https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html ("AS" section)
https://www.gnu.org/software/automake/manual/html_node/Assembly-Support.html

The great thing about standards is that there are so many of them. :) (Note that we don't use implicit rules or automake.)

If people wanted to write a patch, we'd consider taking it, but we are not going to fix this ourselves, because I don't think it's particularly broken.

Severity: -- → S4
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.