Skip to content

Commit

Permalink
(PA-4718) Updates for Solaris and agent-runtime-main
Browse files Browse the repository at this point in the history
This PR updates Solaris on agent-runtime-main to:

* Build libffi, with gmake
* Build Ruby 3.2.2 with OpenCSW gcc
* Configure rubygem-ffi, but still expected to fail. rubygem-ffi will be
fixed at a later point
* Also installs a new GCC and autotools as part of the image.
  • Loading branch information
cthorn42 committed Jun 29, 2023
1 parent 1a77733 commit 307a97a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
12 changes: 10 additions & 2 deletions configs/components/_base-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,16 @@
end
pkg.environment 'LDFLAGS', "#{settings[:ldflags]} -Wl,-bmaxdata:0x80000000"
elsif platform.is_solaris?
pkg.environment 'PATH', "#{settings[:bindir]}:/usr/ccs/bin:/usr/sfw/bin:$(PATH):/opt/csw/bin"
pkg.environment 'CC', "/opt/pl-build-tools/bin/#{settings[:platform_triple]}-gcc"
# See PA-5639, if we decide to go without OpenCSW GCC then we can simplify this logic
if ruby_version_y >= '3.0'
pkg.environment 'PATH', "#{settings[:bindir]}:/opt/csw/bin:/usr/ccs/bin:/usr/sfw/bin:$(PATH)"
pkg.environment 'CC', '/opt/csw/bin/gcc'
pkg.environment 'LD', '/opt/csw/bin/gld'
pkg.environment 'AR', '/opt/csw/bin/gar'
else
pkg.environment 'PATH', "#{settings[:bindir]}:/usr/ccs/bin:/usr/sfw/bin:$(PATH):/opt/csw/bin"
pkg.environment 'CC', "/opt/pl-build-tools/bin/#{settings[:platform_triple]}-gcc"
end
pkg.environment 'CXX', "/opt/pl-build-tools/bin/#{settings[:platform_triple]}-g++"
pkg.environment 'LDFLAGS', "-Wl,-rpath=#{settings[:libdir]}"
if platform.os_version == '10'
Expand Down
1 change: 1 addition & 0 deletions configs/components/libffi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
pkg.environment "PATH", "/opt/pl-build-tools/bin:$(PATH):/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin:#{settings[:bindir]}"
pkg.environment "CFLAGS", "#{settings[:cflags]} -std=c99"
pkg.environment "LDFLAGS", settings[:ldflags]
pkg.environment 'MAKE', 'gmake'
elsif platform.is_macos?
pkg.environment "LDFLAGS", settings[:ldflags]
pkg.environment "CFLAGS", settings[:cflags]
Expand Down
4 changes: 3 additions & 1 deletion configs/components/ruby-3.2.2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
# collect2: error: ld returned 16 exit status

pkg.environment 'optflags', "-O2 -fPIC -g0 "
elsif platform.is_solaris?
pkg.environment 'optflags', '-O1'
else
pkg.environment 'optflags', '-O2'
end
Expand Down Expand Up @@ -223,7 +225,7 @@
elsif platform.name =~ /osx-12/
rbconfig_changes["CC"] = 'clang -target arm64-apple-macos12'
else
rbconfig_changes["CC"] = "gcc"
rbconfig_changes["CC"] = 'gcc -E'
rbconfig_changes["warnflags"] = "-Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wno-tautological-compare -Wno-parentheses-equality -Wno-constant-logical-operand -Wno-self-assign -Wunused-variable -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wno-maybe-uninitialized"
end
if platform.name =~ /el-7-ppc64/
Expand Down
3 changes: 2 additions & 1 deletion configs/components/rubygem-ffi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
pkg.environment "MAKE", platform[:make] if platform.is_solaris?

if platform.is_cross_compiled_linux? || platform.is_solaris?
pkg.environment "PATH", "/opt/pl-build-tools/bin:/opt/csw/bin:$(PATH)"
# PA-5639, if we back out the CSW GCC change we should remove the CSW from this path
pkg.environment "PATH", "/opt/csw/bin:/opt/pl-build-tools/bin:$(PATH)"
end

if platform.name =~ /solaris-11-i386/
Expand Down
2 changes: 1 addition & 1 deletion configs/platforms/solaris-11-i386.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
basedir=default" > /var/tmp/vanagon-noask;
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 || exit 1;
/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")
Expand Down

0 comments on commit 307a97a

Please sign in to comment.