From: nobu@... Date: 2021-04-08T22:47:11+00:00 Subject: [ruby-core:103322] [Ruby master Bug#17787] Four AIX build issues with xlc compiler and ruby-3.0.1 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/ Unsubscribe: