From c40aaf4848a2a99fb1c3af37173d106469d25565 Mon Sep 17 00:00:00 2001 From: Aria Li Date: Thu, 29 Jun 2023 13:24:21 -0700 Subject: [PATCH 1/2] (PA-4872) Build OpenSSL 3.0 for Solaris 11 x86_64 --- configs/components/libffi.rb | 8 ++++++++ configs/components/openssl-3.0.rb | 14 ++++++++------ configs/platforms/solaris-11-i386.rb | 1 + configs/projects/_shared-agent-settings.rb | 2 +- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/configs/components/libffi.rb b/configs/components/libffi.rb index 755475062..0604a7363 100644 --- a/configs/components/libffi.rb +++ b/configs/components/libffi.rb @@ -16,6 +16,14 @@ pkg.environment "LDFLAGS", settings[:ldflags] elsif platform.is_solaris? pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin:#{settings[:bindir]}" + # use pl-build-tools for agent-runtime-7.x and /opt/csw for agent-runtime-main project + # if settings[:runtime_project] =~ /7.x/ # try using pl-build-tools to see if that's what the issue is + # pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin:#{settings[:bindir]}" + # else + # pkg.environment "PATH", "/opt/csw/bin:$(PATH):/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin:#{settings[:bindir]}" + # pkg.environment "LD", "/opt/csw/bin/gld" + # pkg.environment "AR", "/opt/csw/bin/gar" + # end pkg.environment "CFLAGS", "#{settings[:cflags]} -std=c99" pkg.environment "LDFLAGS", settings[:ldflags] pkg.environment 'MAKE', 'gmake' diff --git a/configs/components/openssl-3.0.rb b/configs/components/openssl-3.0.rb index 7ee4733c9..46ddd0219 100644 --- a/configs/components/openssl-3.0.rb +++ b/configs/components/openssl-3.0.rb @@ -12,6 +12,8 @@ pkg.build_requires 'perl-core' elsif platform.is_windows? pkg.build_requires 'strawberryperl' + elsif platform.is_solaris? + # perl is installed in platform definition else pkg.build_requires 'perl' end @@ -57,13 +59,13 @@ # see https://www.ibm.com/docs/en/aix/7.2?topic=l-ld-command about -R, which is equivalent to -rpath ldflags = "#{settings[:ldflags]} -Wl,-R#{settings[:libdir]} -latomic -lm" target = 'aix-gcc' - # elsif platform.is_solaris? - # pkg.environment 'PATH', '/opt/pl-build-tools/bin:$(PATH):/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin' - # pkg.environment 'CC', "/opt/pl-build-tools/bin/#{settings[:platform_triple]}-gcc" + elsif platform.is_solaris? + pkg.environment 'PATH', '/opt/csw/bin:$(PATH):/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin' + pkg.environment 'CC', "/opt/csw/bin/#{settings[:platform_triple]}-gcc" - # cflags = "#{settings[:cflags]} -fPIC" - # ldflags = "-R/opt/pl-build-tools/#{settings[:platform_triple]}/lib -Wl,-rpath=#{settings[:libdir]} -L/opt/pl-build-tools/#{settings[:platform_triple]}/lib" - # target = platform.architecture =~ /86/ ? 'solaris-x86-gcc' : 'solaris-sparcv9-gcc' + cflags = "#{settings[:cflags]} -fPIC" + ldflags = "-R/opt/csw/#{settings[:platform_triple]}/lib -Wl,-rpath=#{settings[:libdir]} -L/opt/csw/#{settings[:platform_triple]}/lib" + target = platform.architecture =~ /86/ ? 'solaris-x86-gcc' : 'solaris-sparcv9-gcc' elsif platform.is_macos? pkg.environment 'PATH', '/opt/pl-build-tools/bin:$(PATH):/usr/local/bin' diff --git a/configs/platforms/solaris-11-i386.rb b/configs/platforms/solaris-11-i386.rb index d6d758232..a4962effb 100644 --- a/configs/platforms/solaris-11-i386.rb +++ b/configs/platforms/solaris-11-i386.rb @@ -1,5 +1,6 @@ platform "solaris-11-i386" do |plat| plat.inherit_from_default + plat.make "gmake" packages = %w( pl-binutils-i386 diff --git a/configs/projects/_shared-agent-settings.rb b/configs/projects/_shared-agent-settings.rb index eec0e18d7..0cb7c71ea 100644 --- a/configs/projects/_shared-agent-settings.rb +++ b/configs/projects/_shared-agent-settings.rb @@ -156,7 +156,7 @@ proj.setting(:ldflags, "-L#{proj.libdir} -Wl,-rpath=#{proj.libdir},-z,relro,-z,now") end -if ruby_version_x == "3" && !platform.is_solaris? +if ruby_version_x == "3" proj.setting(:openssl_version, '3.0') elsif platform.name =~ /^redhatfips-/ proj.setting(:openssl_version, '1.1.1-fips') From c47a9e2e53422b1883a1c8311259cd092179b27f Mon Sep 17 00:00:00 2001 From: Christopher Thorn Date: Fri, 30 Jun 2023 10:54:17 -0700 Subject: [PATCH 2/2] (PA-4872) OpenSSL 3 work for Solaris-11-x86-64 This PR continues Aria's work for getting Solaris 11 x86-64 building openssl 3. This uses OpenCSW's GCC to build openssl. --- configs/components/libffi.rb | 8 -------- configs/components/openssl-3.0.rb | 2 +- configs/platforms/solaris-11-i386.rb | 1 - configs/projects/_shared-agent-settings.rb | 2 +- 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/configs/components/libffi.rb b/configs/components/libffi.rb index 0604a7363..755475062 100644 --- a/configs/components/libffi.rb +++ b/configs/components/libffi.rb @@ -16,14 +16,6 @@ pkg.environment "LDFLAGS", settings[:ldflags] elsif platform.is_solaris? pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin:#{settings[:bindir]}" - # use pl-build-tools for agent-runtime-7.x and /opt/csw for agent-runtime-main project - # if settings[:runtime_project] =~ /7.x/ # try using pl-build-tools to see if that's what the issue is - # pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin:#{settings[:bindir]}" - # else - # pkg.environment "PATH", "/opt/csw/bin:$(PATH):/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin:#{settings[:bindir]}" - # pkg.environment "LD", "/opt/csw/bin/gld" - # pkg.environment "AR", "/opt/csw/bin/gar" - # end pkg.environment "CFLAGS", "#{settings[:cflags]} -std=c99" pkg.environment "LDFLAGS", settings[:ldflags] pkg.environment 'MAKE', 'gmake' diff --git a/configs/components/openssl-3.0.rb b/configs/components/openssl-3.0.rb index 46ddd0219..fb732ac9c 100644 --- a/configs/components/openssl-3.0.rb +++ b/configs/components/openssl-3.0.rb @@ -61,7 +61,7 @@ target = 'aix-gcc' elsif platform.is_solaris? pkg.environment 'PATH', '/opt/csw/bin:$(PATH):/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin' - pkg.environment 'CC', "/opt/csw/bin/#{settings[:platform_triple]}-gcc" + pkg.environment 'CC', "/opt/csw/bin/gcc" cflags = "#{settings[:cflags]} -fPIC" ldflags = "-R/opt/csw/#{settings[:platform_triple]}/lib -Wl,-rpath=#{settings[:libdir]} -L/opt/csw/#{settings[:platform_triple]}/lib" diff --git a/configs/platforms/solaris-11-i386.rb b/configs/platforms/solaris-11-i386.rb index a4962effb..ffb028168 100644 --- a/configs/platforms/solaris-11-i386.rb +++ b/configs/platforms/solaris-11-i386.rb @@ -42,7 +42,6 @@ echo "mirror=https://artifactory.delivery.puppetlabs.net/artifactory/generic__remote_opencsw_mirror/testing" > /var/tmp/vanagon-pkgutil.conf; pkgadd -n -a /var/tmp/vanagon-noask -d http://get.opencsw.org/now all /opt/csw/bin/pkgutil --config=/var/tmp/vanagon-pkgutil.conf -y -i libffi_dev autoconf gcc4core || exit 1; - ntpdate pool.ntp.org] plat.output_dir File.join("solaris", "11", "PC1") end diff --git a/configs/projects/_shared-agent-settings.rb b/configs/projects/_shared-agent-settings.rb index 0cb7c71ea..23537215b 100644 --- a/configs/projects/_shared-agent-settings.rb +++ b/configs/projects/_shared-agent-settings.rb @@ -156,7 +156,7 @@ proj.setting(:ldflags, "-L#{proj.libdir} -Wl,-rpath=#{proj.libdir},-z,relro,-z,now") end -if ruby_version_x == "3" +if ruby_version_x == "3" proj.setting(:openssl_version, '3.0') elsif platform.name =~ /^redhatfips-/ proj.setting(:openssl_version, '1.1.1-fips')