ports/132294: [PATCH] lang/ruby18: Add option to build with
Profile-Guided Optimization
Mario Sergio Fujikawa Ferreira
lioux at FreeBSD.org
Tue Jun 23 16:26:09 UTC 2009
Hi,
I do not think this is exclusive to PGO (profile guided optimization) builds. I am receiving the exact same error message on math/libjbigi (which is now marked broken because of this). It is not just recompiling with -fPIC. That did not fix math/libjbigi.
/usr/bin/ld: /usr/lib/libgcov.a(_gcov_one_value_profiler.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
Unfortunately, I do not have an amd64 FBSD install to pursue this one. I am not even sure how to begin. We might need someone knowledgeable on the gcc build toolchain.
My suggestion would be (perhaps) checking math/libjibi 1st. It could be an easier target (very small build). We could fix that one 1st then try the same fix on lang/ruby18.
However, I would require your assistance since I do not have a amd64 FBSD install.
Incidentally, this is the exact same error message reported for the www/firefox3 PGO PR ports/132231. I am CCing the firefox3 maintainer so that he can follow this issue as well.
Regards,
Quoting Stanislav Sedov <stas at FreeBSD.org>:
> Hi, Mario!
>
> What's regarding the amd64 problem I asked before? Is it fixed?
> If you missed the prvious email, I'm including it here.
>
> Begin forwarded message:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Sat, 28 Feb 2009 09:19:26 -0300
> Mario Sergio Fujikawa Ferreira <lioux at FreeBSD.org> mentioned:
>
>> Hi,
>>
>> I did some work on the lang/ruby18 to enable Profile-Guided
>> Optimization (PGO) build support.
>>
>> What I did? (Steps 1-4 handled by pgo port target).
>>
>> ------- RECIPE
>> 1) Compile everything with CFLAGS/LDFLAGS containing
>> '-fprofile-generate';
>>
>> 2) Run lots of test cases to generate profiling information
>> (make check);
>>
>> 3) Remove all binaries leaving only the profiling information behind;
>>
>> 4) Replace all instances of '-fprofile-generate' with
>> '-fprofile-use';
>>
>> 5) Re-compile everything using the profiling information.
>> -------
>>
>> If I did it correctly, you should not notice any differences
>> on port usage aside from PGO option and a huge build compilation
>> time. Please, verify if you can that I did all steps of the "RECIPE"
>> correctly.
>>
>> I am not a ruby expert so I would like input on this one:
>>
>> 1) Does it perform better than ruby18 compiled without PGO?
>> Hard number benchmarks welcome. Check
>> http://github.com/acangiano/ruby-benchmark-suite/tree/master
>>
>> 2) Also, could others run specification conformance
>> verification checks on the resulting ruby interpreter?
>> So that we have multiple cross verification. Perhaps,
>> with rubyspec?
>>
>> I hope you find this useful and that it performs as expected.
>> I want to go after lang/ruby19. Perhaps, even python and perl5.
>>
>> The modified port file can be found at
>>
>> http://people.freebsd.org/~lioux/ruby18-pgo-2009022800.tbz[1]
>>
>> but the patch is so small that I have it as an attachment.
>>
>> Regards,
>>
>> --
>> Mario S F Ferreira - DF - Brazil - "I guess this is a signature."
>> feature, n: a documented bug | bug, n: an undocumented feature
>>
>>
>> !DSPAM:49a92be2967008612027430!
>>
>
> Hi!
>
> Thanks for a great work. I'll look which benchmark suite I can intergrate
> into the port to profile ruby more precisely.
>
> BTW, is it supposed to work on amd64? I'm receiving the following:
> cc -shared -fprofile-generate -Wl,-soname,libruby18.so.18 array.o
> bignum.o class.o compar.o dir.o dln.o enum.o enumerator.o
> error.o eval.o file.o gc.o hash.o inits.o io.o marshal.o
> math.o numeric.o object.o pack.o parse.o process.o prec.o
> random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o
> string.o struct.o time.o util.o variable.o version.o dmyext.o
> -lcrypt -lm -rpath=/usr/lib:/usr/local/lib -pthread -o
> libruby18.so.18
> /usr/bin/ld: /usr/lib/libgcov.a(_gcov_one_value_profiler.o):
> relocation R_X86_64_32 can not be used when making a shared object;
> recompile with -fPIC
> /usr/lib/libgcov.a: could not read symbols: Bad value
> *** Error code 1
>
> Guess we need a PIC version of gcov...
>
> - --
> Stanislav Sedov
> ST4096-RIPE
> -----BEGIN PGP SIGNATURE-----
>
> iEYEARECAAYFAknbEa4ACgkQK/VZk+smlYFL+wCeKNM6sCjKnvrmlJ/xvIui5bI1
> jH4Anizk6Apf3DZHIdbi5YXpiX5HRuT3
> =L3b3
> -----END PGP SIGNATURE-----
>
> Best regards,
> --
> Stanislav Sedov
> ST4096-RIPE
>
>
--
Mario S F Ferreira - DF - Brazil - "I guess this is a signature."
feature, n: a documented bug | bug, n: an undocumented feature
Links:
------
[1] http://people.freebsd.org/%7Elioux/ruby18-pgo-2009022800.tbz
More information about the freebsd-gecko
mailing list