From d9a79f0ed968d0f78dbd7dd2fcb39f4f42530c3c Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 16 Dec 2024 09:58:09 -0500 Subject: [PATCH 1/2] ext: revert the undefinition of FORTIFY_SOURCE Introduced in 0b49210c for gnu/musl cross-compatibility --- ext/nokogiri/extconf.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/nokogiri/extconf.rb b/ext/nokogiri/extconf.rb index 430d8e191a..c7af9cddf3 100644 --- a/ext/nokogiri/extconf.rb +++ b/ext/nokogiri/extconf.rb @@ -847,7 +847,7 @@ def configure # The libiconv configure script doesn't accept "arm64" host string but "aarch64" recipe.host = recipe.host.gsub("arm64-apple-darwin", "aarch64-apple-darwin") - cflags = concat_flags(ENV["CFLAGS"], "-O2", "-U_FORTIFY_SOURCE", "-g") + cflags = concat_flags(ENV["CFLAGS"], "-O2", "-g") recipe.configure_options += [ "--disable-dependency-tracking", @@ -911,7 +911,7 @@ def configure end cppflags = concat_flags(ENV["CPPFLAGS"]) - cflags = concat_flags(ENV["CFLAGS"], "-O2", "-U_FORTIFY_SOURCE", "-g") + cflags = concat_flags(ENV["CFLAGS"], "-O2", "-g") if cross_build_p cppflags = concat_flags(cppflags, "-DNOKOGIRI_PRECOMPILED_LIBRARIES") @@ -971,7 +971,7 @@ def configure recipe.patch_files = Dir[File.join(PACKAGE_ROOT_DIR, "patches", "libxslt", "*.patch")].sort end - cflags = concat_flags(ENV["CFLAGS"], "-O2", "-U_FORTIFY_SOURCE", "-g") + cflags = concat_flags(ENV["CFLAGS"], "-O2", "-g") if darwin? && !cross_build_p recipe.configure_options << "RANLIB=/usr/bin/ranlib" unless ENV.key?("RANLIB") From 74b1b98c4015cdecb6a57410c95735440deddec1 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 16 Dec 2024 10:14:00 -0500 Subject: [PATCH 2/2] ext: revert libxml2 config --without-tls this reverts a change from 004e6a6e / #3031 that prevented an unresolved symbol on Musl when running the generic Linux native gem. --- ext/nokogiri/extconf.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/nokogiri/extconf.rb b/ext/nokogiri/extconf.rb index c7af9cddf3..70e2fe0cc9 100644 --- a/ext/nokogiri/extconf.rb +++ b/ext/nokogiri/extconf.rb @@ -952,7 +952,6 @@ def configure "--with-c14n", "--with-debug", "--with-threads", - "--without-tls", # see https://github.com/sparklemotion/nokogiri/issues/3031 "CPPFLAGS=#{cppflags}", "CFLAGS=#{cflags}", ]