Issue #9437 has been updated by Perry Smith.


This issue is bigger than I thought.  While miniruby and perhaps ruby itself are fixed, other shared objects are not fixed.  e.g.

    dump -H ./.ext/powerpc-aix6.1.0.0/enc/euc_jp.so
    
    ./.ext/powerpc-aix6.1.0.0/enc/euc_jp.so:
    
                            ***Loader Section***
                          Loader Header Information
    VERSION#         #SYMtableENT     #RELOCent        LENidSTR
    0x00000001       0x0000000c       0x0000003c       0x00000104       
    
    #IMPfilID        OFFidSTR         LENstrTBL        OFFstrTBL
    0x00000002       0x00000410       0x00000163       0x00000514       
    
    
                            ***Import File Strings***
    INDEX  PATH                          BASE                MEMBER              
    0      .:/gsa/ausgsa/projects/r/ruby/prvm/ruby-2.1.0/lib:/gsa/ausgsa-p9/06/ruby/bin/../lib/gcc/powerpc-ibm-aix6.1.0.0/4.5.2:/gsa/ausgsa-p9/06/ruby/bin/../lib/gcc:/gsa/ausgsa-p9/06/ruby/bin/../lib/gcc/powerpc-ibm-aix6.1.0.0/4.5.2/../../..:/usr/lib:/lib                                         
    1                                    libruby.so                              

Of all of the shared objects built, only libruby.so has the corrected libpath.  To do this right, not only does miniruby, ruby, and libruby.so need to be built right but all of the shared objects as well as any gem that is built needs to be built right.

I don't understand ruby's build process nor the process of building gem very well.  I will continue to explore...


----------------------------------------
Bug #9437: Build of ruby 2.1.0 fails on AIX 6.1
https://bugs.ruby-lang.org/issues/9437#change-44845

* Author: Perry Smith
* Status: Feedback
* Priority: Normal
* Assignee: Yutaka Kanemoto
* Category: platform/aix
* Target version: current: 2.2.0
* ruby -v: -
* Backport: 1.9.3: DONTNEED, 2.0.0: DONTNEED, 2.1: REQUIRED
----------------------------------------
miniruby will not load and gets an error of:

```
linking miniruby
Could not load program ./miniruby:
        Dependent module libgmp.a(libgmp.so.10) could not be loaded.
Could not load module libgmp.a(libgmp.so.10).
System error: No such file or directory
make: *** [.rbconfig.time] Error 255
```

The dump -H of miniruby shows:

```
dump -H miniruby 

miniruby:

                        ***Loader Section***
                      Loader Header Information
VERSION#         #SYMtableENT     #RELOCent        LENidSTR
0x00000001       0x00000811       0x000031ec       0x000000b9       

#IMPfilID        OFFidSTR         LENstrTBL        OFFstrTBL
0x00000007       0x000318c8       0x0000942e       0x00031981       


                        ***Import File Strings***
INDEX  PATH                          BASE                MEMBER              
0      /gsa/ausgsa/projects/r/ruby/prvm/ruby-2.1.0/lib:/usr/lib:/lib                                         
1                                    libpthread.a        shr_comm.o          
2                                    libpthread.a        shr_xpg5.o          
3                                    libgmp.a            libgmp.so.10        
4                                    libcrypt.a          shr.o               
5                                    libc.a              shr.o               
6                                    librtl.a            shr.o               
```

Note the dependency of libgmp.  libgmp is not in /usr/lib or /lib but is in another directory that the compiler knows about via the prefix path but Ruby does not.  So the link succeeds because ld knows how to find libgmp but the execution does not because of the embedded LIBPATH (element 0 above).  This has come up before.  I can work around the issue by various ways but I thought I should open an issue.

I'm happy to help out with debug or more data.




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