#70779 closed defect (fixed)
clang-17 build fails on Sequoia
Reported by: | jwhowarth | Owned by: | markmentovai (Mark Mentovai) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.10.1 |
Keywords: | Cc: | cjones051073 (Chris Jones), markmentovai (Mark Mentovai) | |
Port: | clang-17 |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
In attempting to install apbs, I discovered that the clang-17 build fails as follows...
/Library/Developer/CommandLineTools/usr/bin/clang -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DL_cas -DMODEL=2 -DSIZE=1 -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-17/clang-17/work/llvm-project-17.0.6.src/compiler-rt/lib/builtins -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-17/clang-17/work/build/projects/compiler-rt/lib/builtins -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-17/clang-17/work/llvm-project-17.0.6.src/compiler-rt/lib/builtins -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-17/clang-17/work/build/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-17/clang-17/work/llvm-project-17.0.6.src/llvm/include -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=10.7 -fPIC -O3 -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer -DHAS_ASM_LSE -Werror=format-nonliteral -DDONT_DEFINE_EPRINTF -arch arm64 -target arm64-apple-macos10.7 -darwin-target-variant arm64-apple-ios13.1-macabi -MD -MT projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins_arm64_osx.dir/outline_atomic_helpers.dir/outline_atomic_cas1_2.S.o -MF projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins_arm64_osx.dir/outline_atomic_helpers.dir/outline_atomic_cas1_2.S.o.d -o projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt.builtins_arm64_osx.dir/outline_atomic_helpers.dir/outline_atomic_cas1_2.S.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-17/clang-17/work/build/projects/compiler-rt/lib/builtins/outline_atomic_helpers.dir/outline_atomic_cas1_2.S /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-17/clang-17/work/build/projects/compiler-rt/lib/builtins/outline_atomic_helpers.dir/outline_atomic_cas1_2.S:145:116: error: non-private labels cannot appear between .cfi_startproc / .cfi_endproc pairs .text %% .balign 16 %% .globl __aarch64_cas1_acq %% %% .private_extern __aarch64_cas1_acq %% %% .cfi_startproc %% __aarch64_cas1_acq: %% ^ /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-17/clang-17/work/build/projects/compiler-rt/lib/builtins/outline_atomic_helpers.dir/outline_atomic_cas1_2.S:145:98: error: previous .cfi_startproc was here .text %% .balign 16 %% .globl __aarch64_cas1_acq %% %% .private_extern __aarch64_cas1_acq %% %% .cfi_startproc %% __aarch64_cas1_acq: %%
The clang-18 build doesn't have this problem.
Change History (33)
comment:1 Changed 7 weeks ago by jwhowarth
Description: | modified (diff) |
---|
comment:2 Changed 7 weeks ago by cjones051073 (Chris Jones)
comment:3 Changed 7 weeks ago by cjones051073 (Chris Jones)
Cc: | cjones051073 added |
---|
comment:4 Changed 7 weeks ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|
See also #70710 for the same error affecting gcc-13.
comment:5 Changed 7 weeks ago by cjones051073 (Chris Jones)
See https://github.com/macports/macports-ports/commit/8e4cf778021470a4f5cd2adc5566d43f79f56baf
that limits clang fallback on macOS15+ to clang-18 (or newer once clang-19 is added).
If clang-17 is ever fixed for macOS15+ this can be reviewed.
comment:6 follow-up: 9 Changed 7 weeks ago by jwhowarth
FYI, so far the only sensible commit that I've identified in llvm 18.x to back port to llvm 17.0.6 is this one.
Reland "[MC][AsmParser] Diagnose improperly nested .cfi frames" This showed up when simplifying some large testcase, where the cfi directives became out of sync with the proc's they enclose.
Now restricted to platforms that support .subsections_via_symbols.
This reverts commit 797b68c.
Fixes: #72802
Differential revision: https://reviews.llvm.org/D153167
rdar://111459507
https://github.com/llvm/llvm-project/commit/d506aa4edfa66074db3dc1fa84da9d9c80d71500
Unfortunately, this change alone appears to be insufficient to eliminate the build failures on Sequoia.
comment:7 Changed 7 weeks ago by cjones051073 (Chris Jones)
Unless upstream fixes LLVM 17 themselves I think we should just limit clang on macOS15 on our side to clang-18 or newer, which work fine. There should be no need to *require* clang-17 really.
comment:8 Changed 7 weeks ago by markemer (Mark Anderson)
Yeah - if clang 18 and 19 build and work, I'm ok with just limiting clang on macOS 15+
I assume nothing (or almost nothing) that requires 17 won't build with 18/19?
comment:9 follow-up: 10 Changed 7 weeks ago by markemer (Mark Anderson)
Replying to jwhowarth:
FYI, so far the only sensible commit that I've identified in llvm 18.x to back port to llvm 17.0.6 is this one.
Reland "[MC][AsmParser] Diagnose improperly nested .cfi frames" This showed up when simplifying some large testcase, where the cfi directives became out of sync with the proc's they enclose.
Now restricted to platforms that support .subsections_via_symbols.
This reverts commit 797b68c.
Fixes: #72802
Differential revision: https://reviews.llvm.org/D153167
rdar://111459507
https://github.com/llvm/llvm-project/commit/d506aa4edfa66074db3dc1fa84da9d9c80d71500
Unfortunately, this change alone appears to be insufficient to eliminate the build failures on Sequoia.
Maybe the error is in the Xcode compiler? Could we try compiling with one of ours. Like clang18 from MP?
comment:10 Changed 7 weeks ago by cjones051073 (Chris Jones)
Replying to markemer:
Replying to jwhowarth:
FYI, so far the only sensible commit that I've identified in llvm 18.x to back port to llvm 17.0.6 is this one.
Reland "[MC][AsmParser] Diagnose improperly nested .cfi frames" This showed up when simplifying some large testcase, where the cfi directives became out of sync with the proc's they enclose.
Now restricted to platforms that support .subsections_via_symbols.
This reverts commit 797b68c.
Fixes: #72802
Differential revision: https://reviews.llvm.org/D153167
rdar://111459507
https://github.com/llvm/llvm-project/commit/d506aa4edfa66074db3dc1fa84da9d9c80d71500
Unfortunately, this change alone appears to be insufficient to eliminate the build failures on Sequoia.
Maybe the error is in the Xcode compiler? Could we try compiling with one of ours. Like clang18 from MP?
anyone who wishes to can try that for themselves.
> sudo port install clang-17 configure.compiler=macports-clang-18
comment:12 Changed 7 weeks ago by markemer (Mark Anderson)
Sadly, no that fails - it's annoying that this is not really a valid error - but I don't see a good way of fixing it in clang-17
comment:13 Changed 6 weeks ago by markmentovai (Mark Mentovai)
Cc: | markmentovai added |
---|
comment:14 Changed 6 weeks ago by markmentovai (Mark Mentovai)
Replying to markemer:
Sadly, no that fails - it's annoying that this is not really a valid error - but I don't see a good way of fixing it in clang-17
A straightforward cherry-pick of llvm 7939ce39dac0 to release/17.x is all that’s needed. That change is trivial and not incorrect in any circumstance. It applies cleanly as far back as llvm-13, which should be enough for MacPorts, which has already dropped ≤ llvm-14 on ≥ macOS 14 (MacPorts 0c2af4734924).
I can send a pull request if that’d be helpful, but in light of comment:7, I’m not sure it’s worth the time.
comment:15 Changed 6 weeks ago by cjones051073 (Chris Jones)
If the patch needed is indeed that simple the I think its worth trying…
comment:16 Changed 6 weeks ago by cjones051073 (Chris Jones)
Running a test for clang-17 on macOS15 arm64 ...
comment:17 Changed 6 weeks ago by cjones051073 (Chris Jones)
Seems to have worked ! clang-17 built fine and passes a few test builds I threw at it.
Will tests updates to a few more clang versions before pushing an update.
comment:18 Changed 6 weeks ago by markmentovai (Mark Mentovai)
I just prepared https://github.com/macports/macports-ports/pull/25912 for this and was going to do it back to clang-14.
comment:19 Changed 6 weeks ago by cjones051073 (Chris Jones)
OK thanks, if you can add the other clangs there we can go with your PR.
comment:20 Changed 6 weeks ago by markmentovai (Mark Mentovai)
llvm-14, at least, will require more than just this fix, for the same issue in other assembler source.
What do you prefer?
- Don’t touch a version if it’s not being fixed fully
- Apply the (still correct) fix from llvm-project 7939ce39dac0, but leave the ports marked broken on darwin-24 if more fixes will be needed in the future
- Wait until we have a fix for everything
comment:21 Changed 6 weeks ago by markmentovai (Mark Mentovai)
comment:22 Changed 6 weeks ago by markmentovai (Mark Mentovai)
Owner: | set to markmentovai |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:23 Changed 6 weeks ago by markmentovai (Mark Mentovai)
For llvm-14, llvm-15, and llvm-16, there was an additional problem building the lldb-14, lldb-15, and lldb-16 subports. The lldb problem occurred with the macOS 14 SDK, so it’s somewhat long-standing, but I didn’t find any reports on file about it, so I’ll just deal with it here.
I’ve updated each of the pull requests for those versions to include an additional commit to fix lldb.
Please attach a complete build log from a clean build attempt of clang-17