Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Assembler 'make' errors on Mac OS X
2013-07-19, 21:32
Post: #1
Assembler 'make' errors on Mac OS X
Hi, all.

I'm stumped.

I'm trying to build this package on Mac OS 10.8.3 (command-line tools from Xcode 4.6.3), but getting an error during the make process. I've only found one hit on these forums, but no resolution - I've got the same issue:
http://forum.ipxe.org/showthread.php?tid=4559

$ make
FATAL:/usr/bin/../libexec/as/x86_64/as: I don't understand '-' flag!
[...]
[DEPS] libgcc/__divdi3.c
FATAL:/usr/bin/../libexec/as/x86_64/as: I don't understand '-' flag!
[...]
FATAL:/usr/bin/../libexec/as/x86_64/as: I don't understand '-' flag!
[BUILD] bin/__divdi3.o
In file included from <command-line>:0:
./include/compiler.h:196:1: error: "__weak" redefined
<built-in>: error: this is the location of the previous definition
make: *** [bin/__divdi3.o] Error 1

It seems that an option is being set in the makefiles that the assembler doesn't like. But I've scanned every makefile, tried commenting out every possible ASFLAG assignment, and still I'm getting this error.

Running make -p doesn't reveal a smoking gun. The issue seems to surround the __divdi3.c module, but I'm unclear why the assembler would be called for it (or where).

Caveat: I'm a hack c++/asm/perl coder at best, so out of my element here.

Help!
Find all posts by this user
Quote this message in a reply
2013-07-20, 17:26
Post: #2
RE: Assembler 'make' errors on Mac OS X
Try make V=1, which should output the full build commands as they happen. That should enable you to see what is actually going wrong. Also remember that most of the Makefile is in Makefile.housekeeping (and yeah, it is wickedly complex).
Visit this user's website Find all posts by this user
Quote this message in a reply
2013-07-22, 23:02
Post: #3
RE: Assembler 'make' errors on Mac OS X
Thanks, Robin. I didn't see that option in man, but curiously it only reveals the gcc commands (or, only what it perceives to be build instructions, rather than all shell calls). I managed to narrow down the error to this shell call in Makefile.housekeeping:
OLDGAS := $(shell $(AS) --version | grep -q '2\.9\.1' && $(ECHO) -DGAS291)

It looks like that console error is probably cosmetic, and due to --version flag not being supported by 'as'. The real hangup was this hard error:
./include/compiler.h:196:1: error: "__weak" redefined

I scanned for "__weak" and only got a hit in compiler.h for its definition. I first tried making it conditional, then tried commenting it out, both with the same result (apparently it's being pre-defined somewhere outside of ipxe's source). That pre-definition may in itself be a conflict, but getting past that error just revealed the next layer of the onion:

[BUILD] bin/__divdi3.o
cc1: error in backend: Global variable 'obj___divdi3' has an invalid section specifier '.provided': mach-o section specifier requires a segment and section separated by a comma.
make: *** [bin/__divdi3.o] Error 1


Any guidance? Am I swimming upstream trying to get this to build under Xcode's tools? Or am I but one small step away from the solution?

In my other thread, you made a good suggestion to just install an Ubuntu VM to do the build. That would probably be pretty quick, but I've tried to avoid springing up VMs unless I really need to.

Thanks,
Richard
Find all posts by this user
Quote this message in a reply
2013-07-24, 13:11
Post: #4
RE: Assembler 'make' errors on Mac OS X
I think you might be close to something here. I would suggest you file a bug report on the mailing-list about this issue. There might be a trivial fix. I'm not entirely sure, but that reference to .provided might have something to do with the recent changes to be able to build the *.licence Makefile targets. If you try to build with NO_WERROR=1 on the make command line, does it complete properly or not? My guess is not, because that last error doesn't seem like a warning-turned-into-error.
Visit this user's website Find all posts by this user
Quote this message in a reply
2015-06-20, 23:26
Post: #5
RE: Assembler 'make' errors on Mac OS X
Did you ever solve this problem?

I am attempting to build the software located at this address: https://github.com/nineties/amber

Code:
cd rowl0; /Applications/Xcode.app/Contents/Developer/usr/bin/make
as main.s -o main.o --32
FATAL:/opt/local/bin/../libexec/as/x86_64/as: I don't understand '-' flag!
make[1]: *** [main.o] Error 1
make: *** [all] Error 2

I'm taking a look at the flags that 'as' uses, because even when I attempt to do something simple like:

Code:
$ as --help

I get

Code:
FATAL:/opt/local/bin/../libexec/as/x86_64/as: I don't understand '-' flag!
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)