|
From: Rich C. <Ric...@me...> - 2005-07-01 13:32:46
|
When I build objs for shared objects on x86_64, I have to include -fPIC. How is it that the nightly builds on x86_64 pass without this flag ? Thx. gcc -fpie -m64 -fomit-frame-pointer -Wmissing-prototypes -Winline -Wall -Wshadow -O -g -Wno-long-long -o stage2 -Wl,--export-dynamic -g -Wl,-version-script ./valgrind.vs -Wl,--whole-archive m_replacemalloc/libreplacemalloc_core.a -Wl,--no-whole-archive -pie m_cpuid.o m_debugger.o m_debuglog.o m_errormgr.o m_execontext.o m_hashtable.o m_libcbase.o m_libcassert.o m_libcfile.o m_libcmman.o m_libcprint.o m_libcproc.o m_libcsignal.o m_machine.o m_main.o m_mallocfree.o m_options.o m_profile.o m_pthreadmodel.o m_redir.o m_signals.o m_skiplist.o m_stacks.o m_stacktrace.o m_syscall.o m_threadmodel.o m_threadstate.o m_tooliface.o m_trampoline.o m_translate.o m_transtab.o m_ume.o m_debuginfo/libdebuginfo.a m_demangle/libdemangle.a m_scheduler/libscheduler.a m_dispatch/libdispatch.a m_aspacemgr/libaspacemgr.a m_sigframe/libsigframe.a m_syswrap/libsyswrap.a /data/rhcoe/src/vex/libvex.a -ldl /usr/bin/ld: /data/rhcoe/src/vex/libvex.a(irdefs.o): relocation R_X86_64_32S can not be used when making a shared object; recompile with -fPIC /data/rhcoe/src/vex/libvex.a: could not read symbols: Bad value collect2: ld returned 1 exit status -- Rich Coe ric...@me... General Electric Healthcare Technologies |
|
From: Tom H. <to...@co...> - 2005-07-01 13:48:13
|
In message <20050701083045.23bd87d6@godzilla>
Rich Coe <Ric...@me...> wrote:
> When I build objs for shared objects on x86_64, I have to include
> -fPIC. How is it that the nightly builds on x86_64 pass without this flag ?
Who said they don't have it? They do... Well actually they the -fpie
flag instead which is that is actually needed.
To be honest you would be better configuring with --disable-pie
instead as the resulting valgrind will be much faster. It will have
a restricted address space however.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Rich C. <Ric...@me...> - 2005-07-01 14:21:09
|
Well, in the snippet I posted, ld was complaining about libvex.a, which is not being built with -fPIC. In general, I've found a lib.a obj is built without -fPIC is built into a shared obj, ld complains that the .a hasn't been built with -fPIC. On Fri, 01 Jul 2005 14:48:06 +0100 Tom Hughes <to...@co...> wrote: > In message <20050701083045.23bd87d6@godzilla> > Rich Coe <Ric...@me...> wrote: > > > When I build objs for shared objects on x86_64, I have to include > > -fPIC. How is it that the nightly builds on x86_64 pass without this flag ? > > Who said they don't have it? They do... Well actually they the -fpie > flag instead which is that is actually needed. > > To be honest you would be better configuring with --disable-pie > instead as the resulting valgrind will be much faster. It will have > a restricted address space however. > > Tom -- Rich Coe ric...@me... General Electric Healthcare Technologies |
|
From: Tom H. <to...@co...> - 2005-07-01 14:31:11
|
In message <20050701091838.5d537186@godzilla>
Rich Coe <Ric...@me...> wrote:
> Well, in the snippet I posted, ld was complaining about libvex.a, which
> is not being built with -fPIC.
It is if you set EXTRA_CFLAGS when you build it, which is what my
overnight build scripts do. Until building vex is integrated into
the valgrind build process you need to make sure you set EXTRA_CFLAGS
to something that is compatible with the way you have configured
valgrind.
> In general, I've found a lib.a obj is built without -fPIC is built into
> a shared obj, ld complains that the .a hasn't been built with -fPIC.
It isn't built into a shared object though, it is built into a
position independent executable (assuming valgrind was configured
to use PIE mode) which means it needs -fpie although -fpic/-fPIC
will also work but may be more expensive.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|