Bug #17787

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

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 Include/limits.h uses the gcc extension `__builtin_unreachable()` __builtin_unreachable() directly, this does not exist on xlc, I think it should be replaced by "`UNREACHABLE`" "UNREACHABLE" but I just used an empty statement: 

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

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

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

 The checks for this in the 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: 

 #4: The configure script incorrectly identifies the compiler as supporting `-fdeclspec`. -fdeclspec.    It might be good to just omit these checks on the xlc compiler.    I also tested the patches to `fdeclspec` 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` fdeclspec checks entirely: