https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112008-07-25T17:04:47ZRuby Issue Tracking SystemRuby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=6072008-07-25T17:04:47Zroberto (Ollivier Robert)roberto+ruby-lang@keltia.freenix.fr
<ul></ul><p>=begin<br>
1.8.6-P110 compiles fine BTW:</p>
<p>...<br>
compiling win32ole<br>
compiling zlib<br>
llvm-gcc-4.2 -I. -I../.. -I../../.. -I../../../ext/zlib -DHAVE_ZLIB_H -DOS_CODE=OS_UNIX -fno-common -O -pipe -pipe -fno-common -c ../../../ext/zlib/zlib.c<br>
cc -dynamic -bundle -undefined suppress -flat_namespace -o ../../.ext/i686-darwin8.11.1/zlib.bundle zlib.o -L"." -L"../.." -L. -lz -lpthread -ldl -lobjc<br>
making ruby<br>
llvm-gcc-4.2 -O -pipe -pipe -fno-common -DRUBY_EXPORT -L. main.o -lruby-static -lpthread -ldl -lobjc -o ruby<br>
1440 [9:24] roberto@roberto-al:ruby-1.8.6-p110/build> make test<br>
test succeeded</p>
<p>=end</p> Ruby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=6132008-07-27T09:10:12Zko1 (Koichi Sasada)
<ul><li><strong>Assignee</strong> set to <i>ko1 (Koichi Sasada)</i></li></ul><p>=begin</p>
<p>=end</p> Ruby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=11602008-09-22T17:54:36Zko1 (Koichi Sasada)
<ul><li><strong>Priority</strong> changed from <i>Normal</i> to <i>3</i></li></ul><p>=begin</p>
<p>=end</p> Ruby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=12512008-09-28T16:46:48Zyugui (Yuki Sonoda)yugui@yugui.jp
<ul><li><strong>Target version</strong> set to <i>3.0</i></li></ul><p>=begin<br>
Ruby currently does not support llvm-gcc, but in the future ....<br>
=end</p> Ruby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=12812008-09-30T20:44:49Zroberto (Ollivier Robert)roberto+ruby-lang@keltia.freenix.fr
<ul><li><strong>File</strong> <a href="/attachments/99">Picture_1.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/99/Picture_1.png">Picture_1.png</a> added</li></ul><p>=begin<br>
I posted some more data on ruby-talk. What I don't see is in which way is it so different that a llvm-compiled binary would spin and not the 1.8 one. I understand that there is a world between the two ruby with respect to bytecode, VM and all that but why just using a different compiler break? Is the 1.9 code so tied to gcc-specific features/code?<br>
=end</p> Ruby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=12822008-09-30T22:43:13Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul></ul><p>=begin<br>
Hi,</p>
<p>In message "Re: <a href="https://blade.ruby-lang.org/ruby-core/19041">[ruby-core:19041]</a> [Bug <a class="issue tracker-1 status-8 priority-4 priority-default closed" title="Bug: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1) (Third Party's Issue)" href="https://bugs.ruby-lang.org/issues/340">#340</a>] 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)"<br>
on Tue, 30 Sep 2008 20:43:48 +0900, Ollivier Robert <a href="mailto:redmine@ruby-lang.org" class="email">redmine@ruby-lang.org</a> writes:</p>
<p>|I posted some more data on ruby-talk. What I don't see is in which way is it so different that a llvm-compiled binary would spin and not the 1.8 one. I understand that there is a world between the two ruby with respect to bytecode, VM and all that but why just using a different compiler break? Is the 1.9 code so tied to gcc-specific features/code?</p>
<p>Perhaps we've just hit slightest incompatibility between compilers. I<br>
know llvm-gcc is a great piece of code, but still there could be bugs<br>
or incompatibility. YARV is a VERY complex code for compilers.</p>
<pre><code> matz.
</code></pre>
<p>=end</p> Ruby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=27422009-01-27T00:45:59Zash.gti (john harrison)ash@greaterthaninfinity.com
<ul></ul><p>=begin<br>
I was able to get Ruby 1.9.1 RC2 to compile and run if I set:</p>
<p>#define RUBY_SETJMP(env) setjmp(env)<br>
#define RUBY_LONGJMP(env,val) longjmp(env,val)</p>
<p>I don't know exactly why, but the llvm-gcc doesn't do __builtin_longjmp and __builtin_setjmp properly, but if you have it use just setjmp and longjmp it seems to compile. It passed most of the tests.</p>
<p>Btw, I am using OS X 10.5.6; llvm from mac ports:</p>
<p>Target: i686-apple-darwin9<br>
Configured with: /var/tmp/llvmgcc42/llvmgcc42-2039~2/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/Developer/usr/llvm-gcc-4.2/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-gxx-include-dir=/usr/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --enable-llvm=/Developer/usr/local --host=i686-apple-darwin9 --target=i686-apple-darwin9<br>
Thread model: posix<br>
gcc version 4.2.1 (Based on Apple Inc. build 5555) (LLVM build 2039)</p>
<p>=end</p> Ruby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=30482009-02-03T22:50:17Zroberto (Ollivier Robert)roberto+ruby-lang@keltia.freenix.fr
<ul><li><strong>File</strong> <a href="/attachments/221">Picture_3.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/221/Picture_3.png">Picture_3.png</a> added</li></ul><p>=begin<br>
Just trying to compile trunk-after-1.9.1 (#22011) using llvm-gcc-4.2 (aka llvm-2.4). miniruby still spins unless configure is given the "--with-setjmp-type=setjmp" parameter. Seems to be running fine compiled like this. Interestingly enough, when I first compiled it w/o the option, the call graph from "Instrument.app" is different from the previous one.<br>
=end</p> Ruby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=59312009-09-21T03:30:20Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<ul><li><strong>Category</strong> set to <i>build</i></li><li><strong>ruby -v</strong> set to <i>-</i></li></ul><p>=begin</p>
<p>=end</p> Ruby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=104042010-04-21T22:18:39Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Third Party's Issue</i></li></ul><p>=begin<br>
Hi,</p>
<p>The issue looks like a fault of llvm-gcc.</p>
<p>I set this ticket as Third Party's issue.<br>
Please report to llvm-gcc community.</p>
<p>BTW, where is the sense in compiling with llvm-gcc to normal<br>
object file?</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a><br>
=end</p> Ruby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=104142010-04-22T01:30:46Zjonforums (Jon Forums)
<ul></ul><p>=begin</p>
<blockquote>
<p>BTW, where is the sense in compiling with llvm-gcc to normal object file?</p>
</blockquote>
<p>You may find this LLVM intro (PDF) helpful in answering your question</p>
<p><a href="http://llvm.org/pubs/2008-10-04-ACAT-LLVM-Intro.pdf" class="external">http://llvm.org/pubs/2008-10-04-ACAT-LLVM-Intro.pdf</a></p>
<p>Jon<br>
=end</p> Ruby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=104152010-04-22T02:05:37Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul></ul><p>=begin<br>
2010/4/22 Jon Forums <a href="mailto:redmine@ruby-lang.org" class="email">redmine@ruby-lang.org</a>:</p>
<blockquote>
<blockquote>
<p>BTW, where is the sense in compiling with llvm-gcc to normal object file?</p>
</blockquote>
<p>You may find this LLVM intro (PDF) helpful in answering your question</p>
<p><a href="http://llvm.org/pubs/2008-10-04-ACAT-LLVM-Intro.pdf" class="external">http://llvm.org/pubs/2008-10-04-ACAT-LLVM-Intro.pdf</a></p>
</blockquote>
<p>I understand the worth of LLVM.<br>
But this ticket is not about compiling into LLVM bytecode, but<br>
compiling into <em>normal object file</em> with llvm-gcc, isn't it?<br>
I think it has no sense but debugging llvm-gcc.</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p>
<p>=end</p> Ruby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=104192010-04-22T02:55:17Zjonforums (Jon Forums)
<ul></ul><p>=begin</p>
<blockquote>
<p>I understand the worth of LLVM.<br>
But this ticket is not about compiling into LLVM bytecode, but<br>
compiling into <em>normal object file</em> with llvm-gcc, isn't it?</p>
</blockquote>
<p>My understanding of the issue is similar to yours; whether llvm-gcc can be used to compile Ruby into normal object files.</p>
<p>My impression (perhaps incorrect) was also that the ticket's concern was whether the build environment could be made to allow the use of llvm-gcc as a compiler.</p>
<p>FWIW, my current interest is in using llvm-gcc to build Ruby to take advantage of the following:</p>
<ul>
<li>LLVM optimizer - LLVM replaces GCC's optimizer and code generator (execution time, compile time, generated code size)</li>
<li>safe to mix and match .o files between GCC and LLVM-gcc compilers</li>
<li>safe to call into other libraries build by other compilers</li>
</ul>
<p>Whether the above turn out to be true, I'm still investigating. However I've had good results so far as I try using the MinGW port of llvm-gcc (as a compiler) for building gvim and Python extensions on Windows and as time permits, I plan to test more with Ruby. As such, I'm also interested in Ruby and Ruby's build system being able to use llvm-gcc as a compiler.</p>
<p>If I misunderstood the ticket's real issue, pardon the noise.</p>
<p>Jon</p>
<p>p.s. - fyi, there are other build issues I've found when using llvm-gcc such as ensuring binutils windres calls the correct compiler when handling Windows resource files, such as adding something like the following to rules:</p>
<p>$(WINDRES) --preprocessor="$(CC) -E -xc" -DRC_INVOKED</p>
<p>p.p.s - If you get a chance and haven't done so already, take a look at the "LLVM as a C and C++ compiler" section of the above mentioned PDF for some SPEC 2000 results.<br>
=end</p> Ruby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=104212010-04-22T04:18:44Zjonforums (Jon Forums)
<ul></ul><p>=begin<br>
forgot a link to other more recent llvm-gcc/clang vs. gcc 4.x comparisons</p>
<p><a href="http://www.phoronix.com/scan.php?page=article&item=gcc_llvm_clang&num=1" class="external">http://www.phoronix.com/scan.php?page=article&item=gcc_llvm_clang&num=1</a><br>
=end</p> Ruby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=104302010-04-22T12:35:27Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul></ul><p>=begin<br>
Hi,</p>
<p>2010/4/22 Jon Forums <a href="mailto:redmine@ruby-lang.org" class="email">redmine@ruby-lang.org</a>:</p>
<blockquote>
<p>p.p.s - If you get a chance and haven't done so already, take a look at the "LLVM as a C and C++ compiler" section of the above mentioned PDF for some SPEC 2000 results.</p>
</blockquote>
<p>Ah, very sorry. I didn't know llvm-gcc uses its own code generator for<br>
even normal object code.</p>
<p>Ruby deeply uses setjmp/longjmp and many non-guraranteed feature of C89.<br>
So it would be very tough test for llvm-gcc :-)</p>
<p>BTW, according to OP, build seems to success with --with-setjmp-type=setjmp.<br>
I'm curious how fast ruby runs.</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p>
<p>=end</p> Ruby master - Bug #340: 1.9/trunk does not work when compiled with llvm-gcc4 2.3 (gcc 4.2.1)https://bugs.ruby-lang.org/issues/340?journal_id=104452010-04-22T22:28:50Zjonforums (Jon Forums)
<ul></ul><p>=begin</p>
<blockquote>
<p>BTW, according to OP, build seems to success with --with-setjmp-type=setjmp.</p>
</blockquote>
<p>Good point; it appears that it closes the specific issue. Anyone who feels strongly about build mods needed for llvm-gcc/clang can always open up a new feature request :)</p>
<p>Thanks for the background info.</p>
<p>Jon<br>
=end</p>