Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, September 2007
Compiling Qt 4.3.1 on linux 64bits: fPIC error


Message 1 in thread

  Hello there!

  I'm trying to compile qt-4.3.1 on linux 64bits machine using the latest
gcc (4.2.1) but with no success.

  The error occurs when trying to compile the "script" library. It looks
like a (simple) missing "-fPIC" but I believe the error is a little more
complex than that. This is not my first time compiling Qt, so my guess is
that this is not  a trivial problem.

  Hope someone could help with this one!

  Thanks in advance

  Alexandre Motta de Andrade
  www.esss.com.br


THE ERROR:
--------------

g++ -m64 -Wl,-rpath,/usr/local/Trolltech/Qt-4.3.1/lib -Wl,-rpath,/usr/local/Trolltech/Qt-4.3.1/lib
 -shared -Wl,-soname,libQtScript.so.4 -o libQtScript.so.4.3.1
.obj/release-shared/qscriptasm.o .obj/release-shared/qscriptast.o
.obj/release-shared/qscriptastvisitor.o
.obj/release-shared/qscriptcompiler.o .obj/release-shared/qscriptecmaarray.o
.obj/release-shared/qscriptecmaboolean.o
.obj/release-shared/qscriptecmacore.o .obj/release-shared/qscriptecmadate.o
.obj/release-shared/qscriptecmafunction.o
.obj/release-shared/qscriptecmaglobal.o
.obj/release-shared/qscriptecmamath.o
.obj/release-shared/qscriptecmanumber.o
.obj/release-shared/qscriptecmaobject.o
.obj/release-shared/qscriptecmaregexp.o
.obj/release-shared/qscriptecmastring.o
.obj/release-shared/qscriptecmaerror.o
.obj/release-shared/qscriptcontext_p.o .obj/release-shared/qscriptengine.o
.obj/release-shared/qscriptengine_p.o
.obj/release-shared/qscriptextenumeration.o
.obj/release-shared/qscriptextvariant.o .obj/release-shared/qscriptcontext.o
.obj/release-shared/qscriptfunction.o .obj/release-shared/qscriptgrammar.o
.obj/release-shared/qscriptlexer.o .obj/release-shared/qscriptclassdata.o
.obj/release-shared/qscriptparser.o
.obj/release-shared/qscriptprettypretty.o
.obj/release-shared/qscriptsyntaxchecker.o
.obj/release-shared/qscriptvalueiterator.o
.obj/release-shared/qscriptvalueimpl.o .obj/release-shared/qscriptvalue.o
.obj/release-shared/qscriptextqobject.o .obj/release-shared/qscriptable.o
.obj/release-shared/qscriptextensionplugin.o
.obj/release-shared/moc_qscriptengine.o
.obj/release-shared/moc_qscriptextensionplugin.o   -L/home/users/ama/Build/qt4-4.3.1/Sources/lib
 -lQtCore -L/home/users/ama/Build/qt4-4.3.1/Sources/lib -lz -lm -pthread -lgthread-2.0
 -lglib-2.0 -lrt -lpthread -ldl

/home/users/ama/Shared/amd64.redhat/binutils-2.17/bin/ld:
.obj/release-shared/qscriptecmaboolean.o: relocation R_X86_64_PC32 against
`QList<QScriptClassInfo*>::append(QScriptClassInfo* const&)'
can not be used when making a shared object; recompile with -fPIC
/home/users/ama/Shared/amd64.redhat/binutils-2.17/bin/ld: final link failed: 
Bad value


--
 [ signature omitted ] 

Message 2 in thread

On Sep 14, 2007, at 6:20 PM, Alexandre Motta de Andrade wrote:

> relocation R_X86_64_PC32

I believe it has something to do with a bug with your versions of gcc  
and binutils.  See http://bugs.gentoo.org/show_bug.cgi?id=186089 for  
users with the same problem, starting around comment #41.

Caleb

Message 3 in thread

  Exactly the problem.

  I've downloaded and compiled binutils 2.18 and it worked just fine.

  Thanks for the fast and precise answer!

  Best Regards


Alexandre Motta de Andrade
www.esss.com.br

"Caleb Tennis" <caleb@xxxxxxxxxxxx> wrote in message 
news:C99012B4-65D7-4837-A164-65A81762BCA2@xxxxxxxxxxxxxxx


On Sep 14, 2007, at 6:20 PM, Alexandre Motta de Andrade wrote:


relocation R_X86_64_PC32


I believe it has something to do with a bug with your versions of gcc and 
binutils.  See http://bugs.gentoo.org/show_bug.cgi?id=186089 for users with 
the same problem, starting around comment #41.


Caleb 


--
 [ signature omitted ] 

Message 4 in thread

Just as a data point, I've gotten this to work on OpenSuse 10.2

This is how I did my most recent build:

./configure --prefix=/usr/local/Trolltech/Qt-4.3.1 -debug \
            --prefix-install \
            -plugin-sql-mysql \
            -I/usr/include/mysql \
            -qt-gif \
            -verbose \
    |& tee configure.out

make |& tee make.out

sudo make install | & tee make.install.out


Alexandre Motta de Andrade wrote:
>   Hello there!
>
>   I'm trying to compile qt-4.3.1 on linux 64bits machine using the latest
> gcc (4.2.1) but with no success.
>
>   The error occurs when trying to compile the "script" library. It looks
> like a (simple) missing "-fPIC" but I believe the error is a little more
> complex than that. This is not my first time compiling Qt, so my guess is
> that this is not  a trivial problem.
>
>   Hope someone could help with this one!
>
>   Thanks in advance
>
>   Alexandre Motta de Andrade
>   www.esss.com.br
>
>
> THE ERROR:
> --------------
>
> g++ -m64 -Wl,-rpath,/usr/local/Trolltech/Qt-4.3.1/lib -Wl,-rpath,/usr/local/Trolltech/Qt-4.3.1/lib
>  -shared -Wl,-soname,libQtScript.so.4 -o libQtScript.so.4.3.1
> .obj/release-shared/qscriptasm.o .obj/release-shared/qscriptast.o
> .obj/release-shared/qscriptastvisitor.o
> .obj/release-shared/qscriptcompiler.o .obj/release-shared/qscriptecmaarray.o
> .obj/release-shared/qscriptecmaboolean.o
> .obj/release-shared/qscriptecmacore.o .obj/release-shared/qscriptecmadate.o
> .obj/release-shared/qscriptecmafunction.o
> .obj/release-shared/qscriptecmaglobal.o
> .obj/release-shared/qscriptecmamath.o
> .obj/release-shared/qscriptecmanumber.o
> .obj/release-shared/qscriptecmaobject.o
> .obj/release-shared/qscriptecmaregexp.o
> .obj/release-shared/qscriptecmastring.o
> .obj/release-shared/qscriptecmaerror.o
> .obj/release-shared/qscriptcontext_p.o .obj/release-shared/qscriptengine.o
> .obj/release-shared/qscriptengine_p.o
> .obj/release-shared/qscriptextenumeration.o
> .obj/release-shared/qscriptextvariant.o .obj/release-shared/qscriptcontext.o
> .obj/release-shared/qscriptfunction.o .obj/release-shared/qscriptgrammar.o
> .obj/release-shared/qscriptlexer.o .obj/release-shared/qscriptclassdata.o
> .obj/release-shared/qscriptparser.o
> .obj/release-shared/qscriptprettypretty.o
> .obj/release-shared/qscriptsyntaxchecker.o
> .obj/release-shared/qscriptvalueiterator.o
> .obj/release-shared/qscriptvalueimpl.o .obj/release-shared/qscriptvalue.o
> .obj/release-shared/qscriptextqobject.o .obj/release-shared/qscriptable.o
> .obj/release-shared/qscriptextensionplugin.o
> .obj/release-shared/moc_qscriptengine.o
> .obj/release-shared/moc_qscriptextensionplugin.o   -L/home/users/ama/Build/qt4-4.3.1/Sources/lib
>  -lQtCore -L/home/users/ama/Build/qt4-4.3.1/Sources/lib -lz -lm -pthread -lgthread-2.0
>  -lglib-2.0 -lrt -lpthread -ldl
>
> /home/users/ama/Shared/amd64.redhat/binutils-2.17/bin/ld:
> .obj/release-shared/qscriptecmaboolean.o: relocation R_X86_64_PC32 against
> `QList<QScriptClassInfo*>::append(QScriptClassInfo* const&)'
> can not be used when making a shared object; recompile with -fPIC
> /home/users/ama/Shared/amd64.redhat/binutils-2.17/bin/ld: final link failed: 
> Bad value
>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>   

--
 [ signature omitted ] 

Message 5 in thread

Qt has compiled successfully from 4.2.0 onward on 64-bit AMD OpenBSD
using gcc 3.3.5(propolice).

Dave Feustel

--
 [ signature omitted ]