NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-amd64/58312: LLVM build fails with MKISCSI=no (HOST_CC=clang)



>Number:         58312
>Category:       port-amd64
>Synopsis:       LLVM build fails with MKISCSI=no (HOST_CC=clang)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-amd64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 05 12:25:00 +0000 2024
>Originator:     Sotiris Lamprinidis
>Release:        10.0
>Organization:
N/A
>Environment:
Darwin  23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64

>Description:
The upstream compiler-rt  sanitizer seems to unconditionally include 'dev/iscsi/iscsi_ioctl.h'

#   compile  asan-m64/sanitizer_platform_limits_netbsd.o
/Users/sl/netbsd-compile/tooldir.arm/bin/x86_64--netbsd-clang++ -frandom-seed=83acdb46 -O2 -Werror -m64 -fPIE -fPIC -m64 -fno-rtti -fno-exceptions -fno-builtin -fno-stack-protector   --sysroot=/Users/sl/netbsd-compile/destdir.amd64 -I/Users/sl/netbsd-src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/../../../../../../../../sys/external/bsd/compiler_rt/dist/lib  -c    /Users/sl/netbsd-src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/../../../../../../../../sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc -o sanitizer_platform_limits_netbsd.o
/Users/sl/netbsd-src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/../../../../../../../../sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc:143:10: fatal error: 'dev/iscsi/iscsi_ioctl.h' file not found
#include <dev/iscsi/iscsi_ioctl.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

*** Failed target:  sanitizer_platform_limits_netbsd.o
*** Failed command: /Users/sl/netbsd-compile/tooldir.arm/bin/x86_64--netbsd-clang++ -frandom-seed=83acdb46 -O2 -Werror -m64 -fPIE -fPIC -m64 -fno-rtti -fno-exceptions -fno-builtin -fno-stack-protector --sysroot=/Users/sl/netbsd-compile/destdir.amd64 -I/Users/sl/netbsd-src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/../../../../../../../../sys/external/bsd/compiler_rt/dist/lib -c /Users/sl/netbsd-src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64/../../../../../../../../sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc -o sanitizer_platform_limits_netbsd.o
*** Error code 1

Could be that external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc is to be merged upstream
>How-To-Repeat:
./build.sh -ax86_64 -mamd64 -cclang  -Uu -VHOST_CC=clang -VHOST_CXX=clang++ -u release
>Fix:
This is a dirty workaround:

Index: external/bsd/compiler_rt/lib/clang/lib/netbsd/sources.mk
===================================================================
RCS file: /cvsroot/src/external/bsd/compiler_rt/lib/clang/lib/netbsd/sources.mk,v
retrieving revision 1.2
diff -u -u -r1.2 sources.mk
--- external/bsd/compiler_rt/lib/clang/lib/netbsd/sources.mk    26 Aug 2019 04:49:45 -0000      1.2
+++ external/bsd/compiler_rt/lib/clang/lib/netbsd/sources.mk    23 Apr 2024 15:30:08 -0000
@@ -45,6 +45,8 @@
 SANITIZER_SOURCES_NOTERMINATION+=      sanitizer_thread_registry.cc
 SANITIZER_SOURCES_NOTERMINATION+=      sanitizer_win.cc
 
+CPPFLAGS.sanitizer_netbsd.cc+= -${"${MKISCSI:tl:My*}" != "":?D:U}SANITIZER_NETBSD_ISCSI
+
 # RTSanitizerCommon
 SANITIZER_SOURCES+=    ${SANITIZER_SOURCES_NOTERMINATION}
 SANITIZER_SOURCES+=    sanitizer_termination.cc
Index: sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc
===================================================================
RCS file: /cvsroot/src/sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc,v
retrieving revision 1.7.22.1
diff -u -u -r1.7.22.1 sanitizer_platform_limits_netbsd.cc
--- sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc  27 Dec 2022 09:58:57 -0000 1.7.22.1
+++ sys/external/bsd/compiler_rt/dist/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc  23 Apr 2024 15:30:21 -0000
@@ -140,7 +140,9 @@
 #include <dev/ir/irdaio.h>
 #include <dev/isa/isvio.h>
 #include <dev/isa/wtreg.h>
+#ifdef SANITIZER_NETBSD_ISCSI
 #include <dev/iscsi/iscsi_ioctl.h>
+#endif
 #include <dev/ofw/openfirmio.h>
 #include <dev/pci/amrio.h>
 #include <dev/pci/mlyreg.h>
@@ -963,6 +965,7 @@
 unsigned struct_gdt_rescan_sz = sizeof(struct gdt_rescan);
 unsigned struct_gdt_statist_sz = sizeof(struct gdt_statist);
 unsigned struct_gdt_ucmd_sz = sizeof(struct gdt_ucmd);
+#ifdef SANITIZER_NETBSD_ISCSI
 unsigned struct_iscsi_conn_status_parameters_sz =
     sizeof(iscsi_conn_status_parameters_t);
 unsigned struct_iscsi_get_version_parameters_sz =
@@ -980,6 +983,7 @@
     sizeof(iscsi_set_node_name_parameters_t);
 unsigned struct_iscsi_wait_event_parameters_sz =
     sizeof(iscsi_wait_event_parameters_t);
+#endif
 unsigned struct_isp_stats_sz = sizeof(isp_stats_t);
 unsigned struct_lsenable_sz = sizeof(struct lsenable);
 unsigned struct_lsdisable_sz = sizeof(struct lsdisable);
@@ -1276,6 +1280,7 @@
 unsigned IOCTL_IRFRAMETTY_SET_DONGLE = IRFRAMETTY_SET_DONGLE;
 unsigned IOCTL_ISV_CMD = ISV_CMD;
 unsigned IOCTL_WTQICMD = WTQICMD;
+#ifdef SANITIZER_NETBSD_ISCSI
 unsigned IOCTL_ISCSI_GET_VERSION = ISCSI_GET_VERSION;
 unsigned IOCTL_ISCSI_LOGIN = ISCSI_LOGIN;
 unsigned IOCTL_ISCSI_LOGOUT = ISCSI_LOGOUT;
@@ -1290,6 +1295,7 @@
 unsigned IOCTL_ISCSI_DEREGISTER_EVENT = ISCSI_DEREGISTER_EVENT;
 unsigned IOCTL_ISCSI_WAIT_EVENT = ISCSI_WAIT_EVENT;
 unsigned IOCTL_ISCSI_POLL_EVENT = ISCSI_POLL_EVENT;
+#endif
 unsigned IOCTL_OFIOCGET = OFIOCGET;
 unsigned IOCTL_OFIOCSET = OFIOCSET;
 unsigned IOCTL_OFIOCNEXTPROP = OFIOCNEXTPROP;



Home | Main Index | Thread Index | Old Index