ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:103317] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1
@ 2021-04-08 21:15 lamont
  2021-04-08 22:06 ` [ruby-core:103319] " xtkoba+ruby
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: lamont @ 2021-04-08 21:15 UTC (permalink / raw)
  To: ruby-core

Issue #17787 has been reported by lamont (Lamont Granquist).

----------------------------------------
Bug #17787: Four AIX build issues with xlc compiler and ruby-3.0.1
https://bugs.ruby-lang.org/issues/17787

* Author: lamont (Lamont Granquist)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [powerpc-aix7.1.5.0]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Yesterday found 4 small issues trying to use xlc to build ruby 3.0 on AIX that prevented building.  My solutions are ugly fixes just to get our own builds going which will not be acceptable, but I'll include links to them.

#1:  Include/limits.h uses the gcc extension __builtin_unreachable() directly, this does not exist on xlc, I think it should be replaced by "UNREACHABLE" but I just used an empty statement:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-builtin-unreachable.patch

the ./configure script is correctly finding rb_cv_func___builtin_unreachable=no

#2: With xlc to get cpp output you must use '>' and not '-o' which differs from COUTFLAG and this line in Makefile.in is incorrect and really needs better detection of this feature and not just assuming CPPOUTFLAG = COUTFLAG.  I simply hardcoded the right value of CPPOUTFLAG:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-cppoutflag.patch

#3: The xlc compiler actually supports gcc's sync builtins.  See the docs here:

https://www.ibm.com/docs/en/SSGH3R_16.1.0/com.ibm.compilers.aix.doc/compiler.pdf#BIFS_GCC_ATOMIC

The checks for this in the configure.ac script are guarded by a check for intel architecture which would need to be properly expanded properly in some way so that those checks would run on aix+xlc as well.  I just forced it on:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-force-gcc-sync-builtins.patch

#4: The configure script incorrectly identifies the compiler as supporting -fdeclspec.  It might be good to just omit these checks on the xlc compiler.  I also tested the patches to fdeclspec which are currently unreleased in master since we needed to backport those to 3.0.1 for M1 mac builds.  This one I just removed the fdeclspec checks entirely:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-nofdeclspec.patch



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [ruby-core:103319] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1
  2021-04-08 21:15 [ruby-core:103317] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1 lamont
@ 2021-04-08 22:06 ` xtkoba+ruby
  2021-04-08 22:35 ` [ruby-core:103321] " lamont
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: xtkoba+ruby @ 2021-04-08 22:06 UTC (permalink / raw)
  To: ruby-core

Issue #17787 has been updated by xtkoba (Tee KOBAYASHI).


An advice from me is that you should not edit `configure` directly, as that file is auto-generated from `configure.ac` which should be edited instead. I am aware that these patches are not intended to be merged as they are.

----------------------------------------
Bug #17787: Four AIX build issues with xlc compiler and ruby-3.0.1
https://bugs.ruby-lang.org/issues/17787#change-91407

* Author: lamont (Lamont Granquist)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [powerpc-aix7.1.5.0]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Yesterday found 4 small issues trying to use xlc to build ruby 3.0 on AIX that prevented building.  My solutions are ugly fixes just to get our own builds going which will not be acceptable, but I'll include links to them.

#1:  Include/limits.h uses the gcc extension __builtin_unreachable() directly, this does not exist on xlc, I think it should be replaced by "UNREACHABLE" but I just used an empty statement:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-builtin-unreachable.patch

the ./configure script is correctly finding rb_cv_func___builtin_unreachable=no

#2: With xlc to get cpp output you must use '>' and not '-o' which differs from COUTFLAG and this line in Makefile.in is incorrect and really needs better detection of this feature and not just assuming CPPOUTFLAG = COUTFLAG.  I simply hardcoded the right value of CPPOUTFLAG:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-cppoutflag.patch

#3: The xlc compiler actually supports gcc's sync builtins.  See the docs here:

https://www.ibm.com/docs/en/SSGH3R_16.1.0/com.ibm.compilers.aix.doc/compiler.pdf#BIFS_GCC_ATOMIC

The checks for this in the configure.ac script are guarded by a check for intel architecture which would need to be properly expanded properly in some way so that those checks would run on aix+xlc as well.  I just forced it on:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-force-gcc-sync-builtins.patch

#4: The configure script incorrectly identifies the compiler as supporting -fdeclspec.  It might be good to just omit these checks on the xlc compiler.  I also tested the patches to fdeclspec which are currently unreleased in master since we needed to backport those to 3.0.1 for M1 mac builds.  This one I just removed the fdeclspec checks entirely:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-nofdeclspec.patch



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [ruby-core:103321] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1
  2021-04-08 21:15 [ruby-core:103317] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1 lamont
  2021-04-08 22:06 ` [ruby-core:103319] " xtkoba+ruby
@ 2021-04-08 22:35 ` lamont
  2021-04-08 22:47 ` [ruby-core:103322] " nobu
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: lamont @ 2021-04-08 22:35 UTC (permalink / raw)
  To: ruby-core

Issue #17787 has been updated by lamont (Lamont Granquist).


Yeah that road requires having all the build tooling installed on our builders, which it turns out we don't (chaotic versions of autoconf and lack of bison on many of them).  Went down that road with some ruby-3.0.0-to-3.0-head patches that were obsoleted by the 3.0.1 release and it became painful to try to produce distributions from the sources and then diff them and sort the diffs to produce patches that applied in correct order.  It was ultimately easier to hit ./configure with a hammer just to get some builds.

----------------------------------------
Bug #17787: Four AIX build issues with xlc compiler and ruby-3.0.1
https://bugs.ruby-lang.org/issues/17787#change-91409

* Author: lamont (Lamont Granquist)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [powerpc-aix7.1.5.0]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Yesterday found 4 small issues trying to use xlc to build ruby 3.0 on AIX that prevented building.  My solutions are ugly fixes just to get our own builds going which will not be acceptable, but I'll include links to them.

#1:  Include/limits.h uses the gcc extension __builtin_unreachable() directly, this does not exist on xlc, I think it should be replaced by "UNREACHABLE" but I just used an empty statement:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-builtin-unreachable.patch

the ./configure script is correctly finding rb_cv_func___builtin_unreachable=no

#2: With xlc to get cpp output you must use '>' and not '-o' which differs from COUTFLAG and this line in Makefile.in is incorrect and really needs better detection of this feature and not just assuming CPPOUTFLAG = COUTFLAG.  I simply hardcoded the right value of CPPOUTFLAG:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-cppoutflag.patch

#3: The xlc compiler actually supports gcc's sync builtins.  See the docs here:

https://www.ibm.com/docs/en/SSGH3R_16.1.0/com.ibm.compilers.aix.doc/compiler.pdf#BIFS_GCC_ATOMIC

The checks for this in the configure.ac script are guarded by a check for intel architecture which would need to be properly expanded properly in some way so that those checks would run on aix+xlc as well.  I just forced it on:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-force-gcc-sync-builtins.patch

#4: The configure script incorrectly identifies the compiler as supporting -fdeclspec.  It might be good to just omit these checks on the xlc compiler.  I also tested the patches to fdeclspec which are currently unreleased in master since we needed to backport those to 3.0.1 for M1 mac builds.  This one I just removed the fdeclspec checks entirely:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-nofdeclspec.patch



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [ruby-core:103322] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1
  2021-04-08 21:15 [ruby-core:103317] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1 lamont
  2021-04-08 22:06 ` [ruby-core:103319] " xtkoba+ruby
  2021-04-08 22:35 ` [ruby-core:103321] " lamont
@ 2021-04-08 22:47 ` nobu
  2021-04-09  3:38 ` [ruby-core:103329] " lamont
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: nobu @ 2021-04-08 22:47 UTC (permalink / raw)
  To: ruby-core

Issue #17787 has been updated by nobu (Nobuyoshi Nakada).

Status changed from Open to Feedback
Description updated

lamont (Lamont Granquist) wrote:
> #1:  internal/bits.h uses the gcc extension `__builtin_unreachable()` directly, this does not exist on xlc, I think it should be replaced by "`UNREACHABLE`" but I just used an empty statement:

Probably `UNREACHABLE_RETURN` is preferable.

> #2: With xlc to get cpp output you must use '`>`' and not '`-o`' which differs from `COUTFLAG` and this line in Makefile.in is incorrect and really needs better detection of this feature and not just assuming `CPPOUTFLAG = COUTFLAG`.  I simply hardcoded the right value of `CPPOUTFLAG`:

Seems fine.

> #3: The xlc compiler actually supports gcc's sync builtins.  See the docs here:

It isn't considered as gcc?
What is `CONFIG["GCC"]` in rbconfig.rb file?
If it is "yes", could you show the part for `rb_cv_gcc_sync_builtins` in config.log file?

> #4: The configure script incorrectly identifies the compiler as supporting `-fdeclspec`.  It might be good to just omit these checks on the xlc compiler.  I also tested the patches to `fdeclspec` which are currently unreleased in master since we needed to backport those to 3.0.1 for M1 mac builds.  This one I just removed the `fdeclspec` checks entirely:

Could you show the part for `-fdecspec` in config.log file?


----------------------------------------
Bug #17787: Four AIX build issues with xlc compiler and ruby-3.0.1
https://bugs.ruby-lang.org/issues/17787#change-91410

* Author: lamont (Lamont Granquist)
* Status: Feedback
* Priority: Normal
* ruby -v: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [powerpc-aix7.1.5.0]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Yesterday found 4 small issues trying to use xlc to build ruby 3.0 on AIX that prevented building.  My solutions are ugly fixes just to get our own builds going which will not be acceptable, but I'll include links to them.

#1:  internal/bits.h uses the gcc extension `__builtin_unreachable()` directly, this does not exist on xlc, I think it should be replaced by "`UNREACHABLE`" but I just used an empty statement:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-builtin-unreachable.patch

the ./configure script is correctly finding `rb_cv_func___builtin_unreachable=no`

#2: With xlc to get cpp output you must use '`>`' and not '`-o`' which differs from `COUTFLAG` and this line in Makefile.in is incorrect and really needs better detection of this feature and not just assuming `CPPOUTFLAG = COUTFLAG`.  I simply hardcoded the right value of `CPPOUTFLAG`:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-cppoutflag.patch

#3: The xlc compiler actually supports gcc's sync builtins.  See the docs here:

https://www.ibm.com/docs/en/SSGH3R_16.1.0/com.ibm.compilers.aix.doc/compiler.pdf#BIFS_GCC_ATOMIC

The checks for this in the configure.ac script are guarded by a check for intel architecture which would need to be properly expanded properly in some way so that those checks would run on aix+xlc as well.  I just forced it on:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-force-gcc-sync-builtins.patch

#4: The configure script incorrectly identifies the compiler as supporting `-fdeclspec`.  It might be good to just omit these checks on the xlc compiler.  I also tested the patches to `fdeclspec` which are currently unreleased in master since we needed to backport those to 3.0.1 for M1 mac builds.  This one I just removed the `fdeclspec` checks entirely:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-nofdeclspec.patch



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [ruby-core:103329] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1
  2021-04-08 21:15 [ruby-core:103317] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1 lamont
                   ` (2 preceding siblings ...)
  2021-04-08 22:47 ` [ruby-core:103322] " nobu
@ 2021-04-09  3:38 ` lamont
  2021-04-09  4:05 ` [ruby-core:103331] " lamont
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: lamont @ 2021-04-09  3:38 UTC (permalink / raw)
  To: ruby-core

Issue #17787 has been updated by lamont (Lamont Granquist).


fdeclspec section is:

```
configure:9228: result: yes
configure:9348: checking whether -fdeclspec is accepted as CFLAGS
configure:9375: xlc_r -q64 -c -q64 -I/opt/chef/embedded/include -D_LARGE_FILES -O  -fdeclspec -q64 -I/opt/chef/embedded/include -D_LARGE_FILES -O conftest.c >&5
configure:9375: $? = 0
configure:9400: result: yes
configure:9425: checking whether -fdeclspec is accepted as CXXFLAGS
configure:9457: xlC_r -q64 -o conftest -q64 -I/opt/chef/embedded/include -D_LARGE_FILES -O -fdeclspec -q64 -I/opt/chef/embedded/include -D_LARGE_FILES -O -q64 -L/opt/chef/embedded/lib -Wl,-blibpath:/opt/chef/e
mbedded/lib:/usr/lib:/lib conftest.cpp  >&5
ld: 0706-005 Cannot find or open file: declspec
        ld:fopen(): No such file or directory
```

later this trainwrecks the configure script with:

```
configure:14675: checking size of long long
configure:14680: xlc_r -q64 -fdeclspec -o conftest -q64 -I/opt/chef/embedded/include -D_LARGE_FILES -O -q64 -I/opt/chef/embedded/include -D_LARGE_FILES -O -q64 -L/opt/chef/embedded/lib -Wl,-blibpath:/opt/chef/embedded/lib:/usr/lib:/lib conftest.c -lm  >&5
ld: 0706-005 Cannot find or open file: declspec
        ld:fopen(): No such file or directory
configure:14680: $? = 255
configure: program exited with status 255
```

----------------------------------------
Bug #17787: Four AIX build issues with xlc compiler and ruby-3.0.1
https://bugs.ruby-lang.org/issues/17787#change-91420

* Author: lamont (Lamont Granquist)
* Status: Feedback
* Priority: Normal
* ruby -v: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [powerpc-aix7.1.5.0]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Yesterday found 4 small issues trying to use xlc to build ruby 3.0 on AIX that prevented building.  My solutions are ugly fixes just to get our own builds going which will not be acceptable, but I'll include links to them.

#1:  internal/bits.h uses the gcc extension `__builtin_unreachable()` directly, this does not exist on xlc, I think it should be replaced by "`UNREACHABLE`" but I just used an empty statement:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-builtin-unreachable.patch

the ./configure script is correctly finding `rb_cv_func___builtin_unreachable=no`

#2: With xlc to get cpp output you must use '`>`' and not '`-o`' which differs from `COUTFLAG` and this line in Makefile.in is incorrect and really needs better detection of this feature and not just assuming `CPPOUTFLAG = COUTFLAG`.  I simply hardcoded the right value of `CPPOUTFLAG`:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-cppoutflag.patch

#3: The xlc compiler actually supports gcc's sync builtins.  See the docs here:

https://www.ibm.com/docs/en/SSGH3R_16.1.0/com.ibm.compilers.aix.doc/compiler.pdf#BIFS_GCC_ATOMIC

The checks for this in the configure.ac script are guarded by a check for intel architecture which would need to be properly expanded properly in some way so that those checks would run on aix+xlc as well.  I just forced it on:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-force-gcc-sync-builtins.patch

#4: The configure script incorrectly identifies the compiler as supporting `-fdeclspec`.  It might be good to just omit these checks on the xlc compiler.  I also tested the patches to `fdeclspec` which are currently unreleased in master since we needed to backport those to 3.0.1 for M1 mac builds.  This one I just removed the `fdeclspec` checks entirely:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-nofdeclspec.patch



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [ruby-core:103331] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1
  2021-04-08 21:15 [ruby-core:103317] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1 lamont
                   ` (3 preceding siblings ...)
  2021-04-09  3:38 ` [ruby-core:103329] " lamont
@ 2021-04-09  4:05 ` lamont
  2021-04-09  9:00 ` [ruby-core:103337] " nobu
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: lamont @ 2021-04-09  4:05 UTC (permalink / raw)
  To: ruby-core

Issue #17787 has been updated by lamont (Lamont Granquist).


xlc does not identify as GCC:

```
# egrep GCC ./3.0.0/powerpc-aix7.1.5.0/rbconfig.rb
  CONFIG["GCC"] = ""
```

```
# egrep gnu config.log
ac_cv_c_compiler_gnu=no
ac_cv_cxx_compiler_gnu=no
rb_cv_prog_gnu_ld=no
```

IF I REMOVE this check:  https://github.com/ruby/ruby/blob/ruby_3_0/configure.ac#L1482 then it works fine:

```
checking for __atomic builtins... no
checking for __sync builtins... yes
checking for __builtin_unreachable... no
```



----------------------------------------
Bug #17787: Four AIX build issues with xlc compiler and ruby-3.0.1
https://bugs.ruby-lang.org/issues/17787#change-91422

* Author: lamont (Lamont Granquist)
* Status: Feedback
* Priority: Normal
* ruby -v: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [powerpc-aix7.1.5.0]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Yesterday found 4 small issues trying to use xlc to build ruby 3.0 on AIX that prevented building.  My solutions are ugly fixes just to get our own builds going which will not be acceptable, but I'll include links to them.

#1:  internal/bits.h uses the gcc extension `__builtin_unreachable()` directly, this does not exist on xlc, I think it should be replaced by "`UNREACHABLE`" but I just used an empty statement:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-builtin-unreachable.patch

the ./configure script is correctly finding `rb_cv_func___builtin_unreachable=no`

#2: With xlc to get cpp output you must use '`>`' and not '`-o`' which differs from `COUTFLAG` and this line in Makefile.in is incorrect and really needs better detection of this feature and not just assuming `CPPOUTFLAG = COUTFLAG`.  I simply hardcoded the right value of `CPPOUTFLAG`:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-cppoutflag.patch

#3: The xlc compiler actually supports gcc's sync builtins.  See the docs here:

https://www.ibm.com/docs/en/SSGH3R_16.1.0/com.ibm.compilers.aix.doc/compiler.pdf#BIFS_GCC_ATOMIC

The checks for this in the configure.ac script are guarded by a check for intel architecture which would need to be properly expanded properly in some way so that those checks would run on aix+xlc as well.  I just forced it on:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-force-gcc-sync-builtins.patch

#4: The configure script incorrectly identifies the compiler as supporting `-fdeclspec`.  It might be good to just omit these checks on the xlc compiler.  I also tested the patches to `fdeclspec` which are currently unreleased in master since we needed to backport those to 3.0.1 for M1 mac builds.  This one I just removed the `fdeclspec` checks entirely:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-nofdeclspec.patch



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [ruby-core:103337] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1
  2021-04-08 21:15 [ruby-core:103317] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1 lamont
                   ` (4 preceding siblings ...)
  2021-04-09  4:05 ` [ruby-core:103331] " lamont
@ 2021-04-09  9:00 ` nobu
  2021-04-10  6:58 ` [ruby-core:103367] " lamont
  2021-04-29  8:54 ` [ruby-core:103653] " nagachika00
  7 siblings, 0 replies; 9+ messages in thread
From: nobu @ 2021-04-09  9:00 UTC (permalink / raw)
  To: ruby-core

Issue #17787 has been updated by nobu (Nobuyoshi Nakada).


Do these patches work?
https://github.com/ruby/ruby/compare/master...nobu:bug/17787-aix-workarounds

----------------------------------------
Bug #17787: Four AIX build issues with xlc compiler and ruby-3.0.1
https://bugs.ruby-lang.org/issues/17787#change-91428

* Author: lamont (Lamont Granquist)
* Status: Feedback
* Priority: Normal
* ruby -v: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [powerpc-aix7.1.5.0]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Yesterday found 4 small issues trying to use xlc to build ruby 3.0 on AIX that prevented building.  My solutions are ugly fixes just to get our own builds going which will not be acceptable, but I'll include links to them.

#1:  internal/bits.h uses the gcc extension `__builtin_unreachable()` directly, this does not exist on xlc, I think it should be replaced by "`UNREACHABLE`" but I just used an empty statement:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-builtin-unreachable.patch

the ./configure script is correctly finding `rb_cv_func___builtin_unreachable=no`

#2: With xlc to get cpp output you must use '`>`' and not '`-o`' which differs from `COUTFLAG` and this line in Makefile.in is incorrect and really needs better detection of this feature and not just assuming `CPPOUTFLAG = COUTFLAG`.  I simply hardcoded the right value of `CPPOUTFLAG`:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-cppoutflag.patch

#3: The xlc compiler actually supports gcc's sync builtins.  See the docs here:

https://www.ibm.com/docs/en/SSGH3R_16.1.0/com.ibm.compilers.aix.doc/compiler.pdf#BIFS_GCC_ATOMIC

The checks for this in the configure.ac script are guarded by a check for intel architecture which would need to be properly expanded properly in some way so that those checks would run on aix+xlc as well.  I just forced it on:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-force-gcc-sync-builtins.patch

#4: The configure script incorrectly identifies the compiler as supporting `-fdeclspec`.  It might be good to just omit these checks on the xlc compiler.  I also tested the patches to `fdeclspec` which are currently unreleased in master since we needed to backport those to 3.0.1 for M1 mac builds.  This one I just removed the `fdeclspec` checks entirely:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-nofdeclspec.patch



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [ruby-core:103367] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1
  2021-04-08 21:15 [ruby-core:103317] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1 lamont
                   ` (5 preceding siblings ...)
  2021-04-09  9:00 ` [ruby-core:103337] " nobu
@ 2021-04-10  6:58 ` lamont
  2021-04-29  8:54 ` [ruby-core:103653] " nagachika00
  7 siblings, 0 replies; 9+ messages in thread
From: lamont @ 2021-04-10  6:58 UTC (permalink / raw)
  To: ruby-core

Issue #17787 has been updated by lamont (Lamont Granquist).


Those work fine, applied here:

https://github.com/chef/omnibus-software/pull/1328/files#diff-a57a53cdb786ca02b297de88fce6855e7928fc0ff4f7e022d0f22185955da1ea

I ditched all my old patches, combined yours with the existing fdeclspec patch in ruby-head (that one would be useful to backport BTW) and applied them not just to AIX but all our build systems and they passed on windows/freebsd/solaris/aix/ubuntu/debian.

----------------------------------------
Bug #17787: Four AIX build issues with xlc compiler and ruby-3.0.1
https://bugs.ruby-lang.org/issues/17787#change-91458

* Author: lamont (Lamont Granquist)
* Status: Feedback
* Priority: Normal
* ruby -v: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [powerpc-aix7.1.5.0]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Yesterday found 4 small issues trying to use xlc to build ruby 3.0 on AIX that prevented building.  My solutions are ugly fixes just to get our own builds going which will not be acceptable, but I'll include links to them.

#1:  internal/bits.h uses the gcc extension `__builtin_unreachable()` directly, this does not exist on xlc, I think it should be replaced by "`UNREACHABLE`" but I just used an empty statement:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-builtin-unreachable.patch

the ./configure script is correctly finding `rb_cv_func___builtin_unreachable=no`

#2: With xlc to get cpp output you must use '`>`' and not '`-o`' which differs from `COUTFLAG` and this line in Makefile.in is incorrect and really needs better detection of this feature and not just assuming `CPPOUTFLAG = COUTFLAG`.  I simply hardcoded the right value of `CPPOUTFLAG`:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-cppoutflag.patch

#3: The xlc compiler actually supports gcc's sync builtins.  See the docs here:

https://www.ibm.com/docs/en/SSGH3R_16.1.0/com.ibm.compilers.aix.doc/compiler.pdf#BIFS_GCC_ATOMIC

The checks for this in the configure.ac script are guarded by a check for intel architecture which would need to be properly expanded properly in some way so that those checks would run on aix+xlc as well.  I just forced it on:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-force-gcc-sync-builtins.patch

#4: The configure script incorrectly identifies the compiler as supporting `-fdeclspec`.  It might be good to just omit these checks on the xlc compiler.  I also tested the patches to `fdeclspec` which are currently unreleased in master since we needed to backport those to 3.0.1 for M1 mac builds.  This one I just removed the `fdeclspec` checks entirely:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-nofdeclspec.patch



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [ruby-core:103653] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1
  2021-04-08 21:15 [ruby-core:103317] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1 lamont
                   ` (6 preceding siblings ...)
  2021-04-10  6:58 ` [ruby-core:103367] " lamont
@ 2021-04-29  8:54 ` nagachika00
  7 siblings, 0 replies; 9+ messages in thread
From: nagachika00 @ 2021-04-29  8:54 UTC (permalink / raw)
  To: ruby-core

Issue #17787 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED to 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE

ruby_3_0 3e07a4edc92f18dec4806961c1b724ac5cf4d6b2 merged revision(s) 3a3033c138c0951ad5edbf02b5c233b58a190d2f.

----------------------------------------
Bug #17787: Four AIX build issues with xlc compiler and ruby-3.0.1
https://bugs.ruby-lang.org/issues/17787#change-91749

* Author: lamont (Lamont Granquist)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [powerpc-aix7.1.5.0]
* Backport: 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONE
----------------------------------------
Yesterday found 4 small issues trying to use xlc to build ruby 3.0 on AIX that prevented building.  My solutions are ugly fixes just to get our own builds going which will not be acceptable, but I'll include links to them.

#1:  internal/bits.h uses the gcc extension `__builtin_unreachable()` directly, this does not exist on xlc, I think it should be replaced by "`UNREACHABLE`" but I just used an empty statement:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-builtin-unreachable.patch

the ./configure script is correctly finding `rb_cv_func___builtin_unreachable=no`

#2: With xlc to get cpp output you must use '`>`' and not '`-o`' which differs from `COUTFLAG` and this line in Makefile.in is incorrect and really needs better detection of this feature and not just assuming `CPPOUTFLAG = COUTFLAG`.  I simply hardcoded the right value of `CPPOUTFLAG`:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-cppoutflag.patch

#3: The xlc compiler actually supports gcc's sync builtins.  See the docs here:

https://www.ibm.com/docs/en/SSGH3R_16.1.0/com.ibm.compilers.aix.doc/compiler.pdf#BIFS_GCC_ATOMIC

The checks for this in the configure.ac script are guarded by a check for intel architecture which would need to be properly expanded properly in some way so that those checks would run on aix+xlc as well.  I just forced it on:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-force-gcc-sync-builtins.patch

#4: The configure script incorrectly identifies the compiler as supporting `-fdeclspec`.  It might be good to just omit these checks on the xlc compiler.  I also tested the patches to `fdeclspec` which are currently unreleased in master since we needed to backport those to 3.0.1 for M1 mac builds.  This one I just removed the `fdeclspec` checks entirely:

https://github.com/chef/omnibus-software/blob/3120a25111a29503a10866cbd4ee9fedcb438cee/config/patches/ruby/ruby-3.0.1-aix-nofdeclspec.patch



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-04-29  8:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 21:15 [ruby-core:103317] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1 lamont
2021-04-08 22:06 ` [ruby-core:103319] " xtkoba+ruby
2021-04-08 22:35 ` [ruby-core:103321] " lamont
2021-04-08 22:47 ` [ruby-core:103322] " nobu
2021-04-09  3:38 ` [ruby-core:103329] " lamont
2021-04-09  4:05 ` [ruby-core:103331] " lamont
2021-04-09  9:00 ` [ruby-core:103337] " nobu
2021-04-10  6:58 ` [ruby-core:103367] " lamont
2021-04-29  8:54 ` [ruby-core:103653] " nagachika00

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).