[ 66%] Building ASM object — /usr/bin/as: unrecognized option '-HHVM'
[ 66%] Building ASM object hphp/CMakeFiles/hphp_runtime_static.dir/runtime/vm/translator/translator-asm-helpers.S.o /usr/bin/as: unrecognized option '-HHVM' make[2]: *** [hphp/CMakeFiles/hphp_runtime_static.dir/runtime/vm/translator/translator-asm-helpers.S.o] Error 1 make[1]: *** [hphp/CMakeFiles/hphp_runtime_static.dir/all] Error 2 make: *** [all] Error 2
cmake -D CMAKE_PREFIX_PATH:PATH=/usr -D LIBINOTIFY_LIBRARY:FILEPATH=/usr/lib64/libnotify.so.1 -D LIBICONV_LIBRARY:FILEPATH=/usr/local/lib/libiconv.so .
cat /etc/centos-release CentOS release 6.4 (Final)
gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/gcc/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ./configure --prefix=/usr/local/gcc -enable-threads=posix -disable-checking -disable-multilib -enable-languages=c,c++ -with-gmp=/usr/local/gmp -with-mpfr=/usr/local/mpfr/ -with-mpc=/usr/local/mpc/ Thread model: posix gcc version 4.6.3 (GCC)
g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/local/gcc/libexec/gcc/x86_64-unknown-linux-gnu/4.6.3/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ./configure --prefix=/usr/local/gcc -enable-threads=posix -disable-checking -disable-multilib -enable-languages=c,c++ -with-gmp=/usr/local/gmp -with-mpfr=/usr/local/mpfr/ -with-mpc=/usr/local/mpc/ Thread model: posix gcc version 4.6.3 (GCC)
git describe src-hphp-588-gcc0ef7c
printenv | egrep "(LD_LIBRARY_PATH|CMAKE_PREFIX_PATH|HPHP_HOME|HPHP_LIB|USE_HHVM)" HPHP_LIB=/home/dev/centos/buildhhvm/../hhvmsrc/hiphop-php/bin LD_LIBRARY_PATH=:/usr/local/mpc/lib:/usr/local/gmp/lib:/usr/local/mpfr/lib/:/usr/local/mpc/lib:/usr/local/gmp/lib:/usr/local/mpfr/lib/:/usr/local/mpc/lib:/usr/local/gmp/lib:/usr/local/mpfr/lib/:/usr/local/mpc/lib:/usr/local/gmp/lib:/usr/local/mpfr/lib/ HPHP_HOME=/home/dev/centos/buildhhvm/../hhvmsrc/hiphop-php USE_HHVM=1 CMAKE_PREFIX_PATH=/home/dev/centos/buildhhvm/../usr
uname -a Linux hhvm 2.6.32-358.2.1.el6.x86_64 #1 SMP Wed Mar 13 00:26:49 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
+1 happening with latest git.
Problematic cmake generation is in this make file
./hphp/CMakeFiles/hphp_runtime_static.dir/flags.make:
ASM_FLAGS =
+1
This is still happening for me on: src-hphp-619-g98466ea
+1
+1
Still not working on src-hphp-641-g34fdda1 :-1:
Even if I remove the -D options from the ASM_FLAGS I get:
[ 66%] Building ASM object hphp/CMakeFiles/hphp_runtime_static.dir/runtime/vm/translator/translator-asm-helpers.S.o
/home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S: Assembler messages:
/home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S:0: Warning: end of file in comment; newline inserted
/home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S:24: Error: bad expression
/home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S:24: Warning: division by zero
/home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S:24: Error: junk at end of line, first unrecognized character is o' /home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S:25: Error: bad expression /home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S:25: Warning: division by zero /home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S:25: Error: junk at end of line, first unrecognized character isW'
/home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S:35: Error: junk //rVmSp' after register /home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S:36: Error: junk//rVmTl' after register
/home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S:37: Error: junk //rVmFp' after register /home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S:38: Error: junk//rStashedAR saved across service requests' after register
/home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S:48: Error: junk //kReservedRSPScratchSpace' after register /home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S:66: Error: junk//kReservedRSPScratchSpace' after register
/home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S:104: Error: symbol enterTCHelper' is already defined /home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S:105: Error: no such instruction:brk 0'
make[2]: *** [hphp/CMakeFiles/hphp_runtime_static.dir/runtime/vm/translator/translator-asm-helpers.S.o] Error 1
make[1]: *** [hphp/CMakeFiles/hphp_runtime_static.dir/all] Error 2
make: *** [all] Error 2
This is because the normal assembler doesn't support trailing // comments and also doesn't have a preprocessor, so #ifdef stuff won't work. Not quite sure which assembler can do this stuff, but to get around it just fix those two issues. See https://gist.github.com/anonymous/5453435
Thanks @rlerdorf that works for me. I'm just curious how it ever worked for anybody else.
I've submitted a Pull Request https://github.com/facebook/hiphop-php/pull/744 to fix this issue based on @rlerdorf gist.
Hrm, ubuntu's assembler had no issue, but as this seems to fix other builds I'll get owen to split the the x86/arm implementations into separate files which we can switch on in the build system.
@sgolemon — That sounds good to me. So will you be merging my PR or taking a different approach?
Your PR ignores AARCH64 (which in fairness, does nothing) so it'll have to be modified. :)
@sgolemon I am suspicious about Ubuntu having an assembler that can handle that file.
The build line that gets generated by cmake in ./hphp/CMakeFiles/hphp_runtime_static.dir/build.make looks like this for me:
cd /home/rlerdorf/hiphop-php/hphp && /usr/bin/as $(ASM_FLAGS) -o CMakeFiles/hphp_runtime_static.dir/runtime/vm/translator/translator-asm-helpers.S.o /home/rlerdorf/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S
So it is being passed directly to /usr/bin/as
If I try to run that directly on my Ubuntu box without any flags I get this:
3:14pm x220:~/hiphop-php/hphp/runtime/vm/translator> /usr/bin/as translator-asm-helpers.S
translator-asm-helpers.S: Assembler messages:
translator-asm-helpers.S: Warning: end of file in comment; newline inserted
translator-asm-helpers.S:24: Error: bad expression
translator-asm-helpers.S:24: Warning: division by zero
translator-asm-helpers.S:24: Error: junk at end of line, first unrecognized character is `o'
translator-asm-helpers.S:25: Error: bad expression
translator-asm-helpers.S:25: Warning: division by zero
translator-asm-helpers.S:25: Error: junk at end of line, first unrecognized character is `W'
translator-asm-helpers.S:35: Error: junk `//rVmSp' after register
translator-asm-helpers.S:36: Error: junk `//rVmTl' after register
translator-asm-helpers.S:37: Error: junk `//rVmFp' after register
translator-asm-helpers.S:38: Error: junk `//rStashedAR saved across service requests' after register
translator-asm-helpers.S:48: Error: junk `//kReservedRSPScratchSpace' after register
translator-asm-helpers.S:66: Error: junk `//kReservedRSPScratchSpace' after register
translator-asm-helpers.S:104: Error: symbol `enterTCHelper' is already defined
translator-asm-helpers.S:105: Error: no such instruction: `brk 0'
And my /usr/bin/as is pretty current:
3:15pm x220:~/hiphop-php/hphp/runtime/vm/translator> /usr/bin/as --version
GNU assembler (GNU Binutils for Ubuntu) 2.23.2
Copyright 2012 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-linux-gnu'.
So it definitely does not handle trailing // comments on the lines there. And testing the other parts. The -DHHVM command line flags:
3:19pm x220:~/hiphop-php/hphp/runtime/vm/translator> /usr/bin/as -DHHVM translator-asm-helpers.S
/usr/bin/as: unrecognized option '-HHVM'
And same goes for the #ifdef stuff inside the file. They are just treated like comments. What I suspect is happening is that your cmake build line is quite different and you aren't running /usr/bin/as directly so that is probably where we should be looking for a fix.
Indeed, my cmake is producing a build line of: gcc -o hphp/CMakeFiles/hphp_runtime_static.dir/runtime/vm/translator/translator-asm-helpers.S.o -c hphp/runtime/vm/translator/translator-asm-helpers.S
What version of cmake is everyone running?
cmake version 2.6-patch 4
cmake --version cmake version 2.6-patch 4
on cat /etc/redhat-release CentOS release 6.4 (Final)
I also have GNU assembler version 2.23.51.0.3-1.el6 20120918.
My comment got eaten. :(
Anyway, think I found the problem. ASM support in cmake was "experimental" up through 2.8.4. I'm using 2.8.7 where it makes the decision to use gcc which handles the ifdefs and the trailing comments and all that goodness.
Could either of you try updating your cmake to 2.8.5 (or higher) to see if that fixes things? I'll make that the minimum version if so.
@sgolemon — I've updated to cmake version 2.8.8 and now I see:
cd /home/dev/centos/hhvmsrc/hiphop-php/hphp && /opt/centos/devtoolset-1.1/root/usr/bin/gcc $(ASM_DEFINES) $(ASM_FLAGS) -o CMakeFiles/hphp_runtime_static.dir/runtime/vm/translator/translator-asm-helpers.S.o -c /home/dev/centos/hhvmsrc/hiphop-php/hphp/runtime/vm/translator/translator-asm-helpers.S
in: ./hphp/CMakeFiles/hphp_runtime_static.dir/build.make on line 10813