https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112012-12-06T11:32:15ZRuby Issue Tracking SystemRuby master - Bug #7279: Zlib load error on HP-UXhttps://bugs.ruby-lang.org/issues/7279?journal_id=344402012-12-06T11:32:15Zalexharv074 (Alex Harvey)alexharv074@gmail.com
<ul></ul><p>I found a workaround.</p>
<p>There is some documentation of HP-UX PA-RISC compiler here<br>
<a href="http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801?ciid=4727276391695110VgnVCM100000275d6e10RCRD" class="external">http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801?ciid=4727276391695110VgnVCM100000275d6e10RCRD</a></p>
<p>(There's probably a better one somewhere but that's the one I used.)</p>
<p>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.</p>
<p>After running configure I made the following change in config.status -</p>
<pre><code>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
</code></pre>
<p>This results in /usr/local/lib/ruby/1.8/hppa2.0w-hpux11.11/rbconfig.rb having</p>
<pre><code># grep RPATHFLAG /usr/local/lib/ruby/1.8/hppa2.0w-hpux11.11/rbconfig.rb
CONFIG["RPATHFLAG"] = " -Wl,+b%1$-s"
</code></pre>
<p>However, the make step still doesn't run properly because now -Wl,+b gets passed to ld, which is also wrong.</p>
<p>Thus after the make step has finished I made another change -</p>
<pre><code>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 ../..
</code></pre>
<p>That works fine. Then cd ../.. and make install and the zlib extension is installed.</p>
<p>Someone who understands how all this stuff works better than I do can hopefully turn this into an actual patch.</p> Ruby master - Bug #7279: Zlib load error on HP-UXhttps://bugs.ruby-lang.org/issues/7279?journal_id=356862013-01-28T17:16:19Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Project</strong> changed from <i>Ruby 1.8</i> to <i>Ruby master</i></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Feedback</i></li><li><strong>Assignee</strong> set to <i>nobu (Nobuyoshi Nakada)</i></li></ul><p>=begin<br>
Could you try this patch?</p>
<p>diff --git a/lib/mkmf.rb b/lib/mkmf.rb<br>
index c9e738a..fe6f771 100644<br>
--- a/lib/mkmf.rb<br>
+++ b/lib/mkmf.rb<br>
@@ -317,9 +317,9 @@ def link_command(ldflags, opt="", libpath=$DEFLIBPATH|$LIBPATH)<br>
'CFLAGS' => "#$CFLAGS",<br>
'ARCH_FLAG' => "#$ARCH_FLAG",<br>
'LDFLAGS' => "#$LDFLAGS #{ldflags}",</p>
<ul>
<li>
<pre><code> 'LIBPATH' => libpathflag(libpath),
'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs",
'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS")
</code></pre>
</li>
</ul>
<ul>
<li>conf['LIBPATH'] = libpath.map {|s| LIBPATHFLAG % RbConfig::expand(s.dup, conf).quote}.join("")<br>
Config::expand(TRY_LINK.dup, conf)<br>
end<br>
=end</li>
</ul> Ruby master - Bug #7279: Zlib load error on HP-UXhttps://bugs.ruby-lang.org/issues/7279?journal_id=356872013-01-28T17:17:48Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>File</strong> <a href="/attachments/3454">bug-7279.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3454/bug-7279.diff">bug-7279.diff</a> added</li><li><strong>Category</strong> set to <i>build</i></li><li><strong>Target version</strong> set to <i>2.0.0</i></li></ul> Ruby master - Bug #7279: Zlib load error on HP-UXhttps://bugs.ruby-lang.org/issues/7279?journal_id=365422013-02-19T00:29:59Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Target version</strong> changed from <i>2.0.0</i> to <i>2.6</i></li></ul> Ruby master - Bug #7279: Zlib load error on HP-UXhttps://bugs.ruby-lang.org/issues/7279?journal_id=369822013-02-25T12:15:03Zalexharv074 (Alex Harvey)alexharv074@gmail.com
<ul></ul><p>Hi Nobuyoshi,</p>
<p>Yes the patch works.</p>
<p>For people viewing this in the archives, it's worth knowing that patch and diff are different on HP-UX. To apply this patch -</p>
<pre><code>cp -p lib/mkmf.rb lib/mkmf.rb.orig
cat <<'EOF' >mkmf.hpux.patch
</code></pre>
<p>*** lib/mkmf.rb.orig Sat Dec 4 17:34:10 2010<br>
--- lib/mkmf.rb Wed Feb 13 16:29:18 2013</p>
<hr>
<p>*** 317,325 ****<br>
'CFLAGS' => "#$CFLAGS",<br>
'ARCH_FLAG' => "#$ARCH_FLAG",<br>
'LDFLAGS' => "#$LDFLAGS #{ldflags}",</p>
<ul>
<li>
<pre><code> 'LIBPATH' => libpathflag(libpath),
'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs",
'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS")
</code></pre>
Config::expand(TRY_LINK.dup, conf)<br>
end</li>
</ul>
<p>--- 317,325 ----<br>
'CFLAGS' => "#$CFLAGS",<br>
'ARCH_FLAG' => "#$ARCH_FLAG",<br>
'LDFLAGS' => "#$LDFLAGS #{ldflags}",<br>
'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs",<br>
'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS")</p>
<ul>
<li>conf['LIBPATH'] = libpath.map {|s| LIBPATHFLAG % RbConfig::expand(s.dup, conf).quote}.join("")<br>
Config::expand(TRY_LINK.dup, conf)<br>
end<br>
EOF<br>
patch lib/mkmf.rb <mkmf.hpux.patch</li>
</ul> Ruby master - Bug #7279: Zlib load error on HP-UXhttps://bugs.ruby-lang.org/issues/7279?journal_id=688372017-12-25T18:15:08Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Target version</strong> deleted (<del><i>2.6</i></del>)</li></ul> Ruby master - Bug #7279: Zlib load error on HP-UXhttps://bugs.ruby-lang.org/issues/7279?journal_id=796382019-07-15T19:36:27Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li></ul>