From: "alexharv074 (Alex Harvey)" Date: 2012-12-06T11:32:16+09:00 Subject: [ruby-core:50601] [Ruby 1.8 - Bug #7279] Zlib load error on HP-UX Issue #7279 has been updated by alexharv074 (Alex Harvey). I found a workaround. There is some documentation of HP-UX PA-RISC compiler here http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801?ciid=4727276391695110VgnVCM100000275d6e10RCRD (There's probably a better one somewhere but that's the one I used.) The +b option is used by the linker to embed a library path list in the executable for use at run time. However, if passing these options via CC or GCC then the option should be -Wl,+b. The mkmf.log file shows, however, that an unknown option +b is being passed directly to gcc. After running configure I made the following change in config.status - mv config.status config.status.orig sed -e 's/^.*RPATHFLAG.*$/S["RPATHFLAG"]=" -Wl,+b%1$-s"/' config.status.orig >config.status chmod +x config.status ./config.status This results in /usr/local/lib/ruby/1.8/hppa2.0w-hpux11.11/rbconfig.rb having # grep RPATHFLAG /usr/local/lib/ruby/1.8/hppa2.0w-hpux11.11/rbconfig.rb CONFIG["RPATHFLAG"] = " -Wl,+b%1$-s" However, the make step still doesn't run properly because now -Wl,+b gets passed to ld, which is also wrong. Thus after the make step has finished I made another change - cd ext/zlib mv Makefile Makefile.orig sed -e 's#^LIBPATH.*$#LIBPATH = -L. -L$(topdir) -L/usr/local/lib +b/usr/local/lib#' Makefile.orig >Makefile make cd ../.. That works fine. Then cd ../.. and make install and the zlib extension is installed. Someone who understands how all this stuff works better than I do can hopefully turn this into an actual patch. ---------------------------------------- Bug #7279: Zlib load error on HP-UX https://bugs.ruby-lang.org/issues/7279#change-34440 Author: alexharv074 (Alex Harvey) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 1.8.7 (2012-06-29 patchlevel 370) [hppa2.0w-hpux11.11] This was apparently a known issue on HP-UX and it is preventing me from compiling zlib http://www.ruby-forum.com/topic/191987 To reproduce - PA-RISC/HP-UX 11.11
# swlist
...
  gcc                                   4.2.3          gcc
  libgcc                                4.2.3          libgcc
  m4                                    1.4.16         m4
  make                                  3.82           make
# /usr/local/bin/ruby extconf.rb --with-zlib-include=/usr/local/include --with-zlib-lib=/usr/local/lib
checking for deflateReset() in -lz... no
checking for deflateReset() in -llibz... no
checking for deflateReset() in -lzlib1... no
checking for deflateReset() in -lzlib... no
checking for deflateReset() in -lzdll... no
# file /usr/local/lib/libz.sl
/usr/local/lib/libz.sl: PA-RISC1.1 shared library
# file /usr/local/include/zlib.h
/usr/local/include/zlib.h:      c program text
I have attached the mkmf.log. -- http://bugs.ruby-lang.org/