Opened 14 months ago

Closed 14 months ago

Last modified 5 weeks ago

#68257 closed defect (fixed)

clang-14 @14.0.6_1+analyzer: error: use of undeclared identifier 'XDR'

Reported by: janmuennich (Jan Münnich) Owned by: Mark Mentovai <mark@…>
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: sonoma Cc: amake (Aaron Madlon-Kay), chrstphrchvz (Christopher Chavez), pspanja (Petar Španja), cjones051073 (Chris Jones), ith140 (Ian Hoffman), dbl001 (dbl)
Port: clang-14

Description

clang-14, installed as a depencency for virt-viewer, fails to build on macOS 14.0 Sonoma. See attached log.

Attachments (1)

main.log.tar.bz2 (49.8 KB) - added by janmuennich (Jan Münnich) 14 months ago.

Download all attachments as: .zip

Change History (27)

Changed 14 months ago by janmuennich (Jan Münnich)

Attachment: main.log.tar.bz2 added

comment:1 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: sonoma added
Port: llvm-14 added; clang-14 removed
Summary: clang-14 @14.0.6_1+analyzer: Failes to build on Sonomaclang-14 @14.0.6_1+analyzer: error: use of undeclared identifier 'XDR'

Lots of errors of this sort in the log:

[  2%] Building CXX object utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/CodeGenRegisters.cpp.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/build/utils/TableGen && /usr/bin/clang++ -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/build/utils/TableGen -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/llvm-project-14.0.6.src/llvm/utils/TableGen -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/build/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/llvm-project-14.0.6.src/llvm/include -pipe -Os -DNDEBUG -I/opt/local/include -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk -mmacosx-version-min=14.0  -fno-exceptions -std=c++14 -MD -MT utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/CodeGenRegisters.cpp.o -MF CMakeFiles/obj.llvm-tblgen.dir/CodeGenRegisters.cpp.o.d -o CMakeFiles/obj.llvm-tblgen.dir/CodeGenRegisters.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/llvm-project-14.0.6.src/llvm/utils/TableGen/CodeGenRegisters.cpp
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/llvm-project-14.0.6.src/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1254:17: error: use of undeclared identifier 'XDR'
CHECK_TYPE_SIZE(XDR);
                ^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/llvm-project-14.0.6.src/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1254:1: error: use of undeclared identifier '__sanitizer_XDR'
CHECK_TYPE_SIZE(XDR);
^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/llvm-project-14.0.6.src/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1439:25: note: expanded from macro 'CHECK_TYPE_SIZE'
  COMPILER_CHECK(sizeof(__sanitizer_##TYPE) == sizeof(TYPE))
                        ^
<scratch space>:47:1: note: expanded from here
__sanitizer_XDR
^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/llvm-project-14.0.6.src/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1255:1: error: use of undeclared identifier '__sanitizer_XDR'; did you mean '__sanitizer_cov'?
CHECK_SIZE_AND_OFFSET(XDR, x_op);
^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/llvm-project-14.0.6.src/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1442:27: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
  COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \
                          ^
<scratch space>:48:1: note: expanded from here
__sanitizer_XDR
^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/llvm-project-14.0.6.src/compiler-rt/lib/sanitizer_common/sanitizer_interface_internal.h:57:38: note: '__sanitizer_cov' declared here
  SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_cov(__sanitizer::u32 *guard);
                                     ^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/llvm-project-14.0.6.src/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1255:1: error: expected expression
CHECK_SIZE_AND_OFFSET(XDR, x_op);
^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/llvm-project-14.0.6.src/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1442:48: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
  COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *)NULL)->MEMBER) == \
                                               ^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/llvm-project-14.0.6.src/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1255:23: error: use of undeclared identifier 'XDR'
CHECK_SIZE_AND_OFFSET(XDR, x_op);
                      ^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/llvm-project-14.0.6.src/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1255:1: error: expected expression
CHECK_SIZE_AND_OFFSET(XDR, x_op);
^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/llvm-project-14.0.6.src/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1443:34: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
                 sizeof(((CLASS *)NULL)->MEMBER));                \
                                 ^

comment:2 Changed 14 months ago by amake (Aaron Madlon-Kay)

Cc: amake added

comment:3 Changed 14 months ago by chrstphrchvz (Christopher Chavez)

#68263 and #68264 are for the same issue.

Can clang-14 be left in the port field of this ticket for visibility, or is that not a good idea?

comment:4 Changed 14 months ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:5 Changed 14 months ago by pspanja (Petar Španja)

Cc: pspanja added

comment:6 Changed 14 months ago by cjones051073 (Chris Jones)

The sanitizers often cause problems with clang, I have more issues with them than anything else. They are also not critical to using the compiler, so one option is we disable them on macOS14 until someone is able to look in more detail (I am on macOS13 and do not plan to update until the linker issues with Xcode 15 and GCC see some sort of resolution).

can I ask anyone running macOS14 to see if

clang-17
clang-16
clang-15

build for you on this OS ?

Last edited 14 months ago by cjones051073 (Chris Jones) (previous) (diff)

comment:7 Changed 14 months ago by cjones051073 (Chris Jones)

Port: clang-14 added; llvm-14 removed

comment:8 Changed 14 months ago by cjones051073 (Chris Jones)

Ryan - The port failing here is clang-14, not llvm-14.

Last edited 14 months ago by cjones051073 (Chris Jones) (previous) (diff)

comment:9 Changed 14 months ago by cjones051073 (Chris Jones)

Cc: cjones051073 added

comment:10 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

I changed the port field because I've observed we often place the top-level port name into the port field, rather than the affected subport name, particularly in cases of python & perl modules. However, subports are an implementation detail that users need not be aware of, so it's probably better if we stop that custom and use the affected port name in the port field in cases other than e.g. python & perl modules.

comment:11 Changed 14 months ago by cjones051073 (Chris Jones)

Indeed. You have to use the correct(sub)port name otherwise the links to track tickets in e.g. https://ports.macports.org/port/clang-14/details/ would be in the wrong port (llvm-14 not clang-14).

comment:12 in reply to:  6 Changed 14 months ago by janmuennich (Jan Münnich)

Replying to cjones051073:

can I ask anyone running macOS14 to see if

clang-17
clang-16
clang-15

build for you on this OS ?

I was able to build all three on the same system without any issues.

comment:13 in reply to:  6 Changed 14 months ago by pspanja (Petar Španja)

Replying to cjones051073:

The sanitizers often cause problems with clang, I have more issues with them than anything else. They are also not critical to using the compiler, so one option is we disable them on macOS14 until someone is able to look in more detail (I am on macOS13 and do not plan to update until the linker issues with Xcode 15 and GCC see some sort of resolution).

can I ask anyone running macOS14 to see if

clang-17
clang-16
clang-15

build for you on this OS ?

They all build perfectly fine.

Thanks for looking into this.

comment:14 Changed 14 months ago by cjones051073 (Chris Jones)

Thanks for the check.

I have excluded clang-14 and older from the fallback list

https://github.com/macports/macports-ports/commits/master

Someone should now open a second ticket against virt-viewer to not force the use of clang-14 on systems where it isn't supported (or just update to use the default fallbacks).

comment:15 Changed 14 months ago by cjones051073 (Chris Jones)

can you see if clang-14 now builds on macOS14 with [370d81aeeea14a617a17867c322f5f6cc3571cd2/macports-ports]?

Last edited 14 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:16 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: ith140 dbl001 added

Has duplicate #68270.

comment:17 in reply to:  11 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to cjones051073:

Indeed. You have to use the correct(sub)port name otherwise the links to track tickets in e.g. https://ports.macports.org/port/clang-14/details/ would be in the wrong port (llvm-14 not clang-14).

Right, that is one of the problems I've observed. We don't really have a solution for that when a problem affects, for example, all of the subports of a python or perl module port. Manually listing every subport in the port field is tedious and not something I've seen done.

comment:18 in reply to:  15 Changed 14 months ago by pspanja (Petar Španja)

Replying to cjones051073:

can you see if clang-14 now builds on macOS14 with [370d81aeeea14a617a17867c322f5f6cc3571cd2/macports-ports]?

It builds without issues now, thanks for the quick fix!

comment:19 Changed 14 months ago by cjones051073 (Chris Jones)

Resolution: fixed
Status: newclosed

comment:20 Changed 14 months ago by markmentovai (Mark Mentovai)

https://github.com/macports/macports-ports/pull/20625 should be a proper fix that doesn’t require disabling the sanitizers.

comment:21 Changed 14 months ago by Mark Mentovai <mark@…>

Owner: set to Mark Mentovai <mark@…>

In 93df941348056bddd6f378306312267032346e98/macports-ports (master):

clang-14: Fix build under Xcode 15, re-enabling sanitizers on macOS 14

This also reverts the following as they relate to clang-14:

370d81aeeea1 llvm-14: Allow build on darwin23 but disable sanitizers
0c2af4734924 llvm-{10-14}: Restrict to darwin < 23

Note that the actual incompatibility was not strictly between clang-14
and Darwin 23 (macOS 14) as these previous commits suggest. The
incompatibility existed between clang-14 and the macOS 14 SDK, which is
part of Xcode 15. The incompatibility equally affected clang-14 on macOS
13 (Darwin 22) using Xcode 15.

This also makes the compiler-rt build for various runtimes targeting iOS
and iOS Simulator work correctly by removing the macOS SDK -syslibroot
when linking, allowing the platform-specific SDK provided by the Clang
build to be effective.

Fixes: #68257

comment:22 Changed 14 months ago by Mark Mentovai <mark@…>

In d75fc11a59095a7a228d95191a07eff5e4f2c09a/macports-ports (master):

clang_compilers: include clang-14 on macOS ≥ 14 again

This undoes the portion of a95b034a84d5 that applied to clang-14, since
#68257 has been fixed and clang-14 now
works with Xcode 15.

comment:23 Changed 14 months ago by dbl001 (dbl)

I am still getting the error on a 2021 iMac 27" (x86-64) with XCode 15.

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-14/clang-14/work/llvm-project-14.0.6.src/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:1254:17: error: use of undeclared identifier 'XDR'
:info:build CHECK_TYPE_SIZE(XDR);

comment:24 Changed 14 months ago by cjones051073 (Chris Jones)

I suspect you have not updated your ports tree to pick up the latest fixes…

comment:25 Changed 6 weeks ago by markmentovai (Mark Mentovai)

In 9e855c03657030f7cc3c85a41a89e09ae453be67/macports-ports (master):

clang-13, llvm-13, lldb-13: fix for macOS ≥ 14

This rolls up backports of the following fixes for later llvm versions
to llvm-13:

93df94134805 clang-14: Fix build under Xcode 15
2605e66ff779 lldb-14: fix build with macOS ≥ 14 SDK (Xcode ≥ 15)
aa0bc47391a7 clang-14: Move libc++*.* libraries to libc++ sub-dir, fix

install names

49df5ce7f1f6 clang-14, llvm-14: restore functionality on macOS 15 (Xcode

16)

References: #68257
References: #70779

comment:26 Changed 5 weeks ago by markmentovai (Mark Mentovai)

In 2981eb25d2ca139de4ada36872cb19886d8e2ec3/macports-ports (master):

clang-12, llvm-12, lldb-12: fix for macOS ≥ 14 (https://github.com/macports/macports-ports/pull/26025)

This rolls up backports of the following fixes for later llvm versions
to llvm-12:

93df94134805 clang-14: Fix build under Xcode 15
2605e66ff779 lldb-14: fix build with macOS ≥ 14 SDK (Xcode ≥ 15)
aa0bc47391a7 clang-14: Move libc++*.* libraries to libc++ sub-dir, fix

install names

49df5ce7f1f6 clang-14, llvm-14: restore functionality on macOS 15 (Xcode

16)

It also enables lldb-12 on macOS ≥ 14, where it was previously
separately disabled.

References: #68257
References: #70779

Note: See TracTickets for help on using tickets.