I'm trying to build v8 for Android on a Mac ... However it fails as follows:
CXX(target) /Users/winston/Work/v8/out/android_arm.release/obj.target/v8_base.arm/src/conversions.o../third_party/icu/linux/icudt46l_dat.S:2:20: error: unexpected token in '.section' directive.section .note.GNU-stack,"",%progbits^../third_party/icu/linux/icudt46l_dat.S:3:18: error: unexpected token in '.section' directive.section .rodata^../third_party/icu/linux/icudt46l_dat.S:6:2: error: unknown directive.hidden icudt46_dat^../third_party/icu/linux/icudt46l_dat.S:8:2: error: unknown directive.type icudt46_dat,%object^it seems to be clang reporting the error -- doesn't support the .GNU-stack directive. In theory, the target toolchain is the android-ndk-r9 and the host toolchain is clang/Xcode 5. I have tried running it with CC and CXX set to llvm-gcc (GCC front end with LLVM backend), however with Xcode 5, GCC is no longer installed. I've also tried setting GYP_DEFINES="clang=0" but to no avail.
On Thursday, September 26, 2013 11:29:33 PM UTC-4, smith.wi...@gmail.com wrote:
I'm trying to build v8 for Android on a Mac ... However it fails as follows:CXX(target) /Users/winston/Work/v8/out/android_arm.release/obj.target/v8_base.arm/src/conversions.o../third_party/icu/linux/icudt46l_dat.S:2:20: error: unexpected token in '.section' directive.section .note.GNU-stack,"",%progbits^../third_party/icu/linux/icudt46l_dat.S:3:18: error: unexpected token in '.section' directive.section .rodata^../third_party/icu/linux/icudt46l_dat.S:6:2: error: unknown directive.hidden icudt46_dat^../third_party/icu/linux/icudt46l_dat.S:8:2: error: unknown directive.type icudt46_dat,%object^it seems to be clang reporting the error -- doesn't support the .GNU-stack directive. In theory, the target toolchain is the android-ndk-r9 and the host toolchain is clang/Xcode 5. I have tried running it with CC and CXX set to llvm-gcc (GCC front end with LLVM backend), however with Xcode 5, GCC is no longer installed. I've also tried setting GYP_DEFINES="clang=0" but to no avail.Turns out the Chromium people reported this to the LLVM folks, who apparently fixed it but suggested a workaround: -no-integrated-asI added -no-integrated-as to android.gypi, as follows:
diff --git a/build/android.gypi b/build/android.gypi index ca09725..ce9498f 100644 --- a/build/android.gypi +++ b/build/android.gypi @@ -238,7 +238,7 @@ }], # _toolset=="target" # Settings for building host targets using the system toolchain. ['_toolset=="host"', { - 'cflags': [ '-m32', '-pthread' ], + 'cflags': [ '-m32', '-pthread', '-no-integrated-as' ],
'ldflags': [ '-m32', '-pthread' ], 'ldflags!': [ '-Wl,-z,noexecstack',However, it still fails, although a little differently:CXX(target) /Users/winston/Work/v8/out/android_arm.release/obj.target/v8_base.arm/src/extensions/gc-extension.o
../third_party/icu/linux/icudt46l_dat.S:2:unknown section type: %progbits ../third_party/icu/linux/icudt46l_dat.S:2:Rest of line ignored. 1st junk character valued 32 ( ). ../third_party/icu/linux/icudt46l_dat.S:5:Unknown pseudo-op: .hidden ../third_party/icu/linux/icudt46l_dat.S:5:Rest of line ignored. 1st junk character valued 105 (i). ../third_party/icu/linux/icudt46l_dat.S:7:Unknown pseudo-op: .type ../third_party/icu/linux/icudt46l_dat.S:7:Rest of line ignored. 1st junk character valued 105 (i). clang: error: assembler command failed with exit code 1 (use -v to see invocation)Hoping someone has some insight on this!-W.
--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I added -no-integrated-as to android.gypi, as follows:diff --git a/build/android.gypi b/build/android.gypi index ca09725..ce9498f 100644 --- a/build/android.gypi +++ b/build/android.gypi @@ -238,7 +238,7 @@ }], # _toolset=="target" # Settings for building host targets using the system toolchain. ['_toolset=="host"', { - 'cflags': [ '-m32', '-pthread' ], + 'cflags': [ '-m32', '-pthread', '-no-integrated-as' ],These are cflags for the "host" toolset...
'ldflags': [ '-m32', '-pthread' ], 'ldflags!': [ '-Wl,-z,noexecstack',However, it still fails, although a little differently:CXX(target) /Users/winston/Work/v8/out/android_arm.release/obj.target/v8_base.arm/src/extensions/gc-extension.o... while here you're compiling with the "target" toolset.
I'm trying to build v8 for Android on a Mac ...However it fails as follows:
CXX(target) /Users/winston/Work/v8/out/android_arm.release/obj.target/v8_base.arm/src/conversions.o../third_party/icu/linux/icudt46l_dat.S:2:20: error: unexpected token in '.section' directive.section .note.GNU-stack,"",%progbits^../third_party/icu/linux/icudt46l_dat.S:3:18: error: unexpected token in '.section' directive.section .rodata^../third_party/icu/linux/icudt46l_dat.S:6:2: error: unknown directive.hidden icudt46_dat^../third_party/icu/linux/icudt46l_dat.S:8:2: error: unknown directive.type icudt46_dat,%object^
So it seems like the section in icu.gyp isn't filtering out the "wrong" versions of icudt46l_dat.S when generating the makefiles. For a Mac build of Android, it should look like this:OBJS := \$(obj).host/$(TARGET)/third_party/icu/mac/icudt46l_dat.oOBJS := \$(obj).host/$(TARGET)/third_party/icu/android/icudt46l_dat.o