diff --git a/nodejs.spec b/nodejs.spec index 642f147a784c9ad1687454262377a62b6dbb0c52..ff3bbd75f266eeeddde31e58539b358753a544ff 100644 --- a/nodejs.spec +++ b/nodejs.spec @@ -1,4 +1,4 @@ -%global baserelease 1 +%global baserelease 2 %{?!_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} %global nodejs_epoch 1 %global nodejs_major 20 @@ -237,10 +237,15 @@ export CXXFLAGS='%{optflags} \ -O3 \ -fno-ipa-icf' -export CFLAGS="$(echo ${CFLAGS} | tr '\n\\' ' ')" -export CXXFLAGS="$(echo ${CXXFLAGS} | tr '\n\\' ' ')" +export CFLAGS="$(echo ${CFLAGS} | tr -s '[:space:]\\' ' ')" +export CXXFLAGS="$(echo ${CXXFLAGS} | tr -s '[:space:]\\' ' ')" export LDFLAGS="%{build_ldflags}" +%if "%toolchain" == "clang" +export CFLAGS="$(echo ${CFLAGS} | sed -e s/-fno-ipa-icf//g)" +export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e s/-fno-ipa-icf//g)" +%endif + %{__python3} configure.py --prefix=%{_prefix} \ --verbose \ --ninja \ @@ -250,12 +255,14 @@ export LDFLAGS="%{build_ldflags}" --shared-zlib \ --shared-brotli \ --shared-libuv \ - --enable-lto \ %{dtrace_configure} \ --with-intl=small-icu \ --with-icu-default-data-dir=%{icudatadir} \ --without-corepack \ - --openssl-use-def-ca-store + --openssl-use-def-ca-store \ +%if "%toolchain" != "clang" + --enable-lto +%endif %ninja_build -C out/Release @@ -402,6 +409,10 @@ NODE_PATH=%{buildroot}%{_prefix}/lib/node_modules:%{buildroot}%{_prefix}/lib/nod %{_pkgdocdir}/npm/docs %changelog +* Fri Nov 29 2024 jchzhou - 1:20.12.1-2 +- fix building w/ clang: only apply '-fno-ipa-icf' for gcc && disable LTO for clang + ld.bfd +- improve the handling of trilling whitespaces in C/CXXFLAGS + * Wed Sep 18 2024 yaoxin - 1:20.12.1-1 - Update to 20.12.1: * CVE-2024-27983 - Assertion failed in node::http2::Http2Session::~Http2Session()