Closed Bug 1551690 Opened 3 years ago Closed 2 years ago

be more specific about the LLVM target on OS X

Categories

(Firefox Build System :: General, enhancement)

All
macOS
enhancement
Not set
normal

Tracking

(firefox69 fixed)

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

References

Details

Attachments

(1 file)

No description provided.

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
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)
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

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

Flags: needinfo?(nfroyd)
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
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Regressions: 1565157
Regressions: 1573355
You need to log in before you can comment on or make changes to this bug.