diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2025-09-28 10:48:24 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2025-10-10 18:10:24 +0000 |
| commit | cda9162a0ffb86dbc36b3cc95c1136dc5c072638 (patch) | |
| tree | 2072ed7b9ee9fa910642479ec18a1c19ca31bac4 | |
| parent | 0ddfb91db0dad2119f4966e8a875576b3cad130e (diff) | |
bsd.port.mk: Make WITHOUT_CPU_CFLAGS also work for CXXFLAGS
In base 0fb33e049ac0 the _CPUFLAGS value (initialized from CPUTYPE in
make.conf) is also being appended to CXXFLAGS, instead of only to
CFLAGS.
Some ports use WITHOUT_CPU_CFLAGS to avoid having CPUTYPE flags added to
their command lines, for example devel/wasi-libcxx*.
bsd.port.mk handles it like so:
. if defined(WITHOUT_CPU_CFLAGS)
. if defined(_CPUCFLAGS)
. if !empty(_CPUCFLAGS)
CFLAGS:= ${CFLAGS:C/${_CPUCFLAGS}//}
. endif
. endif
. endif
However this will no longer work after base 0fb33e049ac0 (which is in
main and stable/15), leading to build errors similar to:
FAILED: [code=1] libcxxabi/src/CMakeFiles/cxxabi_static_objects.dir/cxa_aux_runtime.cpp.o
/usr/local/llvm19/bin/clang++ --target=wasm32-wasi --sysroot=/usr/local/share/wasi-sysroot -DLIBCXXABI_SILENT_TERMINATE -DLIBCXX_BUILDING_LIBCXXABI -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_HAS_NO_THREADS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/wrkdirs/usr/ports/devel/wasi-libcxx19/work/llvm-project-19.1.7.src/libcxxabi/../libcxx/src -I/wrkdirs/usr/ports/devel/wasi-libcxx19/work/.build/include/c++/v1 -I/wrkdirs/usr/ports/devel/wasi-libcxx19/work/llvm-project-19.1.7.src/libcxxabi/include -O2 -pipe -fno-strict-aliasing -march=haswell -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -O2 -pipe -fno-strict-aliasing -march=haswell -DNDEBUG -std=c++23 -D_DEBUG -UNDEBUG -MD -MT libcxxabi/src/CMakeFiles/cxxabi_static_objects.dir/cxa_aux_runtime.cpp.o -MF libcxxabi/src/CMakeFiles/cxxabi_static_objects.dir/cxa_aux_runtime.cpp.o.d -o libcxxabi/src/CMakeFiles/cxxabi_static_objects.dir/cxa_aux_runtime.cpp.o -c /wrkdirs/usr/ports/devel/wasi-libcxx19/work/llvm-project-19.1.7.src/libcxxabi/src/cxa_aux_runtime.cpp
clang++: error: unsupported option '-march=' for target 'wasm32-wasi'
Fix this by using the same logic for CXXFLAGS as for CFLAGS.
PR: 289844, 289673
Approved by: portmgr timeout (2 weeks)
MFH: 2025Q4
(cherry picked from commit 9d078a8bc60d0528b74b88f19b61911818d3a415)
| -rw-r--r-- | Mk/bsd.port.mk | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index 96824b8641e2..2de6b91be4e1 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -1773,6 +1773,7 @@ CFLAGS:= ${CFLAGS:C/ $//} . if defined(_CPUCFLAGS) . if !empty(_CPUCFLAGS) CFLAGS:= ${CFLAGS:C/${_CPUCFLAGS}//} +CXXFLAGS:= ${CXXFLAGS:C/${_CPUCFLAGS}//} . endif . endif . endif |
