be more specific about the LLVM target on OS X

RESOLVED FIXED in Firefox 69

Status

enhancement
RESOLVED FIXED
Last month
29 days ago

People

(Reporter: froydnj, Assigned: froydnj)

Tracking

(Blocks 1 bug)

unspecified
mozilla69
All
macOS
Dependency tree / graph

Firefox Tracking Flags

(firefox69 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

Last month
No description provided.
Assignee

Comment 1

Last month

Our current OS X builds use --target=x86_64-darwin11 (which
corresponds to OS X 10.7). This target is problematic for two reasons:

  • We're actually targeting for OS X 10.9 (MACOSX_DEPLOYMENT_TARGET);
  • It's slightly different from the default Rust target.

Let's address these problems in reverse order: differences from the Rust
target are bad, because the --target we provide to clang and the
Rust target find their way into LLVM bitcode files and the linker will
refuse to link together bitcode files that have incompatible targets.

Why are the two incompatible? The current --target doesn't have a
"vendor" in triple-speak, whereas the Rust one has "apple" as the
vendor (x86_64-apple-darwin) We therefore need to change the
--target we pass to clang to have a vendor of "apple".

This need is behind the {init,toolchain}.configure changes,
but it has ramifications elsewhere, because clang looks for
--target-prefixed build tools. So we have to change the --target
for cctools to get the right tool prefixes and we have to change the
--target for building clang ourselves so that those builds can find
the newly renamed cctools.

Once we've done, that's really enough; we don't *need to address the
first problem: While the --target might be x86_64-apple-darwin11,
both clang and rustc will dynamically choose the target triple that
eventually lands in LLVM bitcode files based on
MACOSX_DEPLOYMENT_TARGET, which we set in all builds. But the current
target is slightly misleading, and the cctools don't need to be prefixed
with a particular Darwin version, since they work for all Darwin
targets. Let's just drop the "11" from the --target and eliminate a
little bit of confusion.

Attachment #9064865 - Attachment description: Bug 1551690 - be more specific about the LLVM target on OS X; r=#build → Bug 1551690 - be more specific about the LLVM target on OS X; r=nalexander

Comment 2

Last month
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2e560a9e4bcf
be more specific about the LLVM target on OS X; r=nalexander

Backed out changeset 2e560a9e4bcf (bug 1551690) for build bustages

Backout: https://hg.mozilla.org/integration/autoland/rev/3166a00a4f13f0bca069681a382c0e8af814eb3f

Failure push: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=2e560a9e4bcffc8476086c1da25c7412cd9a1805

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=247458990&repo=autoland&lineNumber=996

[task 2019-05-21T00:49:01.351Z] 00:49:01 ERROR - Traceback (most recent call last):
[task 2019-05-21T00:49:01.351Z] 00:49:01 INFO - File "/builds/worker/workspace/build/src/configure.py", line 132, in <module>
[task 2019-05-21T00:49:01.351Z] 00:49:01 INFO - sys.exit(main(sys.argv))
[task 2019-05-21T00:49:01.351Z] 00:49:01 INFO - File "/builds/worker/workspace/build/src/configure.py", line 38, in main
[task 2019-05-21T00:49:01.351Z] 00:49:01 INFO - sandbox.run(os.path.join(os.path.dirname(file), 'moz.configure'))
[task 2019-05-21T00:49:01.351Z] 00:49:01 INFO - File "/builds/worker/workspace/build/src/python/mozbuild/mozbuild/configure/init.py", line 441, in run
[task 2019-05-21T00:49:01.351Z] 00:49:01 INFO - self._value_for(option)
[task 2019-05-21T00:49:01.351Z] 00:49:01 INFO - File "/builds/worker/workspace/build/src/python/mozbuild/mozbuild/configure/init.py", line 528, in _value_for
[task 2019-05-21T00:49:01.351Z] 00:49:01 INFO - return self._value_for_option(obj)
[task 2019-05-21T00:49:01.351Z] 00:49:01 INFO - File "/builds/worker/workspace/build/src/python/mozbuild/mozbuild/util.py", line 947, in method_call
[task 2019-05-21T00:49:01.351Z] 00:49:01 INFO - cache[args] = self.func(instance, *args)
[task 2019-05-21T00:49:01.351Z] 00:49:01 INFO - File "/builds/worker/workspace/build/src/python/mozbuild/mozbuild/configure/init.py", line 559, in _value_for_option
[task 2019-05-21T00:49:01.351Z] 00:49:01 INFO - value, option_string = self._helper.handle(option)
[task 2019-05-21T00:49:01.352Z] 00:49:01 INFO - File "/builds/worker/workspace/build/src/python/mozbuild/mozbuild/configure/options.py", line 504, in handle
[task 2019-05-21T00:49:01.352Z] 00:49:01 INFO - extra_ret = option.get_value(extra_arg, extra_origin)
[task 2019-05-21T00:49:01.352Z] 00:49:01 INFO - File "/builds/worker/workspace/build/src/python/mozbuild/mozbuild/configure/options.py", line 377, in get_value
[task 2019-05-21T00:49:01.352Z] 00:49:01 INFO - self.nargs != 1) else ''
[task 2019-05-21T00:49:01.352Z] 00:49:01 INFO - mozbuild.configure.options.InvalidOptionError: --with-toolchain-prefix takes 1 value
[task 2019-05-21T00:49:01.387Z] 00:49:01 INFO - *** Fix above errors and then restart with
[task 2019-05-21T00:49:01.387Z] 00:49:01 INFO - "./mach build"
[task 2019-05-21T00:49:01.387Z] 00:49:01 INFO - client.mk:111: recipe for target 'configure' failed
[task 2019-05-21T00:49:01.387Z] 00:49:01 INFO - make: *** [configure] Error 1
[task 2019-05-21T00:49:01.455Z] 00:49:01 ERROR - Return code: 2
[task 2019-05-21T00:49:01.455Z] 00:49:01 WARNING - setting return code to 2
[task 2019-05-21T00:49:01.455Z] 00:49:01 FATAL - 'mach build -v' did not run successfully. Please check log for errors.
[task 2019-05-21T00:49:01.455Z] 00:49:01 FATAL - Running post_fatal callback...
[task 2019-05-21T00:49:01.455Z] 00:49:01 FATAL - Exiting -1

Flags: needinfo?(nfroyd)

Comment 5

29 days ago
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ae7096d1add7
be more specific about the LLVM target on OS X; r=nalexander
Assignee

Comment 7

29 days ago

Ugh, sorry, I totally missed the tools build failures in the previous push. :(

Flags: needinfo?(nfroyd)

Comment 8

29 days ago
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/167dbfcf5251
be more specific about the LLVM target on OS X; r=nalexander

Comment 9

29 days ago
bugherder
Status: NEW → RESOLVED
Closed: 29 days ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
You need to log in before you can comment on or make changes to this bug.