Closed Bug 924122 Opened 11 years ago Closed 10 years ago

"cc1: error: unrecognized command line option" when building b2g for hamachi

Categories

(Firefox OS Graveyard :: GonkIntegration, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: jerzyglowacki, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; PPC Mac OS X 10_5_8) AppleWebKit/536.26.14+ (KHTML, like Gecko) Version/5.0.6 Safari/533.22.3

Steps to reproduce:

I was trying to build B2G for hamachi phone (Alcatel One Touch Fire) on my Ubuntu 12.04 x86_64. Following the official wiki, I did these steps:

1. I installed the prerequisites:
$ sudo apt-get install autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev libgl1-mesa-dev libx11-dev make zip openjdk-6-jre openjdk-6-jdk android-tools-adb android-tools-fastboot
GCC is in version 4.6.3.

2. I successfully connected the phone, seen in adb devices.

3. I cloned the repo and successfully configured the project:
$ git clone git://github.com/mozilla-b2g/B2G.git
$ cd B2G && ./config.sh hamachi

4. I tried to build the project:
$ ./build.sh -j1 showcommands


Actual results:

Build failed on this command:


target arm C: libc <= bionic/libc/bionic/pthread.c 
prebuilt/linux-x86/ccache/ccache cc -I bionic/libc/stdlib -I bionic/libc/string -I bionic/libc/stdio -I bionic/libc -I out/target/product/hamachi/obj/SHARED_LIBRARIES/libc_intermediates -I dalvik/libnativehelper/include/nativehelper -isystem system/core/include -isystem hardware/libhardware/include -isystem hardware/libhardware_legacy/include -isystem hardware/ril/include -isystem dalvik/libnativehelper/include -isystem frameworks/base/include -isystem frameworks/base/opengl/include -isystem frameworks/base/native/include -isystem external/skia/include -isystem out/target/product/hamachi/obj/include -isystem bionic/libc/arch-arm/include -isystem bionic/libc/include -isystem bionic/libstdc++/include -isystem bionic/libc/kernel/common -isystem bionic/libc/kernel/arch-arm -isystem bionic/libm/include -isystem bionic/libm/include/arm -isystem bionic/libthread_db/include -c  -fno-exceptions -Wno-multichar  -msoft-float -fpic -ffunction-sections -fdata-sections -funwind-tables -fstack-protector -Wa,--noexecstack -Werror=format-security -fno-short-enums -march=armv7-a -mfloat-abi=softfp -mfpu=neon -include system/core/include/arch/linux-arm/AndroidConfig.h -I system/core/include/arch/linux-arm/ -Wno-unused-but-set-variable -fno-builtin-sin -fno-strict-volatile-bitfields -Wno-psabi -mthumb-interwork -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -DNDEBUG -g -Wstrict-aliasing=2 -fgcse-after-reload -frerun-cse-after-loop -frename-registers -DNDEBUG -UDEBUG -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops  -DWITH_ERRLIST -DANDROID_CHANGES -DUSE_LOCKS -DREALLOC_ZERO_BYTES_FREES -D_LIBC=1 -DSOFTFLOAT -DFLOATING_POINT -DINET6 -Ibionic/libc/private -DUSE_DL_PREFIX -DPOSIX_MISTAKE -DLOG_ON_HEAP_ERROR  -DTM_GMTOFF=tm_gmtoff -DUSG_COMPAT=1 -fstrict-aliasing -DHAVE_ARM_TLS_REGISTER -DSPARROW_NEON_OPTIMIZATION -DCORTEX_CACHE_LINE_32 -DANDROID_SMP=1     -MD -MF out/target/product/hamachi/obj/SHARED_LIBRARIES/libc_intermediates/bionic/pthread.d -o out/target/product/hamachi/obj/SHARED_LIBRARIES/libc_intermediates/bionic/pthread.o bionic/libc/bionic/pthread.c 
cc1: error: unrecognized command line option ‘-mfloat-abi=softfp’ 
cc1: error: unrecognized command line option ‘-mfpu=neon’ 
cc1: error: unrecognized command line option ‘-mthumb-interwork’ 
bionic/libc/bionic/pthread.c:1:0: error: bad value (armv7-a) for -march= switch 
make: *** [out/target/product/hamachi/obj/SHARED_LIBRARIES/libc_intermediates/bionic/pthread.o] Error 1 


Expected results:

The build process should succeed.
OS: All → Linux
Hardware: All → x86_64
Was this ever resolved? I just started getting this building for the Flame like a week ago on Fedora 20 - I'm not sure what changed as things were building fine prior to that and I didn't consciously change anything (but I may have done system updates and I did update the b2g build tree).
(In reply to Chris Lord [:cwiiis] from comment #1)
> Was this ever resolved? I just started getting this building for the Flame
> like a week ago on Fedora 20 - I'm not sure what changed as things were
> building fine prior to that and I didn't consciously change anything (but I
> may have done system updates and I did update the b2g build tree).

The output in comment 0 shows a mismatch in the compiler being used for building: the regular host compiler (cc) is being used instead of the ARM cross-compiler. This sounds either like a build system issue or something caused by an environmental variable incorrectly set.
I noticed I still had a TARGET_TOOLS_PREFIX pointing to an old pre-built toolchain that doesn't seem to be necessary anymore. Removing that appears to have fixed the issue (which is I assume that gcc 4.4.3 isn't supported anymore).
(In reply to Chris Lord [:cwiiis] from comment #3)
> I noticed I still had a TARGET_TOOLS_PREFIX pointing to an old pre-built
> toolchain that doesn't seem to be necessary anymore. Removing that appears
> to have fixed the issue (which is I assume that gcc 4.4.3 isn't supported
> anymore).

Good, I'm closing as WORKSFORME then.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.