Closed
Bug 1288442
Opened 8 years ago
Closed 7 years ago
modify android.m4 to use the proper clang flags
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: froydnj, Assigned: froydnj)
References
Details
Attachments
(2 files)
3.00 KB,
patch
|
Details | Diff | Splinter Review | |
7.69 KB,
patch
|
Details | Diff | Splinter Review |
For cross-compilation, we have to pass a --target flag to LLVM and we
have to tell it where to find a GCC-compatible toolchain (presumably for
the linker, assembler, etc.). clang also handles adding directories to
the include search path slightly differently than GCC does, so we need
to compensate for that as well.
Assignee | ||
Comment 1•8 years ago
|
||
I think you were saying at one point that you had plans to automagically detect
--target for clang, but if that isn't going to land anytime soon, I'd like to
get this patch in-tree so that other people can experiment with clang on
android. The -isystem changes are needed in any event.
Attachment #8773312 -
Flags: review?(mh+mozilla)
Comment 2•8 years ago
|
||
Comment on attachment 8773312 [details] [diff] [review]
modify android.m4 to use the proper clang flags
Review of attachment 8773312 [details] [diff] [review]:
-----------------------------------------------------------------
::: build/autoconf/android.m4
@@ +67,5 @@
> AC_MSG_ERROR([not found. Please check your NDK. With the current configuration, it should be in $android_platform])
> fi
>
> + if test "$CC_TYPE" = "clang"; then
> + extra_opts="--target=${llvm_target} -gcc-toolchain $(dirname $(dirname $TOOLCHAIN_PREFIX))"
Adding --target here is conflicting with the changes from bug 1288313.
Attachment #8773312 -
Flags: review?(mh+mozilla)
Assignee | ||
Comment 3•8 years ago
|
||
Compiling with clang using the NDK requires extra flags to be passed,
compared to GCC, and some of the flags passed to GCC don't work with
clang.
Attachment #8778463 -
Flags: review?(mh+mozilla)
Comment 4•8 years ago
|
||
Comment on attachment 8778463 [details] [diff] [review]
modify android.m4 to use the proper flags for compiling with clang
Review of attachment 8778463 [details] [diff] [review]:
-----------------------------------------------------------------
::: build/moz.configure/android-ndk.configure
@@ +155,5 @@
> + if c_compiler.type == 'clang':
> + return ['-isystem',
> + os.path.join(platform_dir, 'usr', 'include'),
> + '-gcc-toolchain',
> + toolchain]
This kind of touches bug 1293543, and I need to give that some thought before saying anything here.
::: build/moz.configure/toolchain.configure
@@ +742,5 @@
> +@depends('--disable-compile-environment', build_project, gonkdir, '--help')
> +def compiling_android(compile_env, build_project, gonkdir, _):
> + return compile_env and (gonkdir or build_project in ('mobile/android', 'js'))
> +
> +include_when('android-ndk.configure', when=compiling_android)
This needs to be included before --with-toolchain-prefix is defined, because of the imply_option. I'd expect this to break on a try build, if it doesn't, there's a bug in python configure.
Attachment #8778463 -
Flags: review?(mh+mozilla)
Assignee | ||
Comment 5•7 years ago
|
||
We're going to address this as part of bug 1163171, because it's a bit tricky to do this *without* switching over to clang wholesale.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•