Comments you submit will be routed for moderation. If you have an account, please log in first.
Modify

Ticket #190 (closed defect: worksforme)

Opened 6 years ago

Last modified 6 years ago

Compile error under AMD 64 bit

Reported by: bpe2004@… Owned by: alwin
Priority: normal Milestone:
Component: All Version: 0.13.x
Severity: major Keywords: compile error, 64bit
Cc:

Description

Compile error under AMD 64 bit Using gcc 4.2.1 , subversion 1.4.4, kde 3.5.7, qt 3.3.8

Linking CXX shared module ../lib/kde3/libkdesvnpart.so /usr/bin/ld: /src/kdesvn-0.13.0/lib/kde3/libsvnfrontend.a(svnitem.o): relocation R_X86_64_PC32 against `vtable for svn::ref_count' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: ld returned 1 exit status make[2]: * [lib/kde3/libkdesvnpart.so] Error 1 make[1]: * [src/CMakeFiles/kdesvnpart.dir/all] Error 2 make: * [all] Error 2

Attachments

Change History

comment:1 Changed 6 years ago by bpe2004@…

Using latestfrom svn (0.14 ?) produces same error.

comment:2 Changed 6 years ago by alwin

  • Status changed from new to assigned
  • Severity changed from minor to major

Some more details about machine and distribution/system would be helpfull. What version of cmake? 'cause on all systems known to me it works.

comment:3 follow-up: ↓ 4 Changed 6 years ago by bpe2004@…

distro -> "Linux from scratch, CBLFS x86-64_64 on an Intel Pentium D, non-multi-lib thus I don't have 32bit libs nor 32 bit compiler, " http://cblfs.cross-lfs.org/index.php/Main_Page"

gcc 4.2.1

binutils 2.17

qt 3.3.8

kde 3.5.7

cmake version 2.4-patch 6

also tried 2.4-patch 7

I'm not familar with cmake nor QT or KDE, actually the error happen in a different object from 0.13 (svnitem.o) vs. trunk (svnlogdlgimp.o). I tried the QValueList sample from QT which does work and apparently svnqt.so does link Ok were the QValueList template with QString is used too.

I did build as below from 'trunk' directory

mkdir build; cd build; cmake ../. make

Failure:

Linking CXX shared module ../lib/kde3/libkdesvnpart.so

/usr/bin/ld: /home/w11281/src/kdesvn_svn/trunk/build/lib/kde3/libsvnfrontend.a(svnlogdlgimp.o): relocation R_X86_64_PC32 against QValueList<QString>::detachInternal() can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: ld returned 1 exit status make[2]: * [lib/kde3/libkdesvnpart.so] Error 1 make[1]: * [src/CMakeFiles/kdesvnpart.dir/all] Error 2

Same failure happen if I do gcc -shared 'ls *.o' ' in build/src/svnfrontend/CMakeFiles/svnfrontend.dir. If I then remove svnlogdlgimp.o above gcc -shared 'ls *.o ' will link w/o error. Seems the problem is somehow with QValueList in svnlogdlgimp.o

After commenting line ~112 in svnlogdlgimp.cpp I get a link failure as above but for QMap ( relocation R_X86_64_PC32 against QMap<long, svn::LogEntry?>:: operator[](long const&)'

LogListViewItem::LogListViewItem(KListView*_parent,const svn::LogEntry&_entry)
    : KListViewItem(_parent),_realName(QString::null)
{
............
    QStringList sp = QStringList::split("
",_message);
    if (sp.count()==0) {
          setText(COL_MSG,_message);
    } else {
 //       setText(COL_MSG,sp[0]); // caused link error
    }
    changedPaths = _entry.changedPaths;
..................

I re-installed QT from source ( 3.3.8 ) acc. to CBLFS instruction, but symptom remains same. I did compile several other packages incl. KDE, I only saw this link failure with kdesvn so far.

comment:4 in reply to: ↑ 3 Changed 6 years ago by alwin

  • Type changed from task to defect

Replying to bpe2004@fastmail.fm:

Ah, ok.

Seems that there is an error inside that cmake doesn't set this flag itself (what it should do) or some defaults are different. I'll check it today.

You must not fiddle with source code, the problem is that - why ever - cmake doesn't set the "-fPIC" flag. (On other system it does, thats why my question).

For a fast workaround you may add "ADD_DEFINITION(-fPIC)" after line

"ENDIF (HAVE_GCC_VISIBILITY)"

in main CMakeLists.txt.

I'll try to integrate a better solution (eg. setting this flag only where real needed, but it doesn't make problems when set on 64bit platforms)

Tnx for your effort

comment:5 Changed 6 years ago by anonymous

Thanks for your fast reply,

I did try "ADD_DEFINITION(-fPIC)" seems not known by cmake so I did "ADD_DEFINITIONS(-fPIC)" which acc. to cmake man page does add -D defines. This didn't help, so I added

SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")

instead. However this didn't help either. Not sure if I looked into the right file, but in

svnfrontend/CMakeFiles/svnfrontend.dir
the file flags.make does contain -fPIC, it can also be seen in build.make after /usr/bin/c++ commands. cmake seem to first explicit run the pre-processor,assembly than somehow to object. ( -E, than -S flag). I could not figure out the flags for the last compile step.

I thought that if -fPIC is missing I should get a lot more errors on other modules too.

Let me know if there is anything you want me try, Thanks,

comment:6 Changed 6 years ago by bpe

  • Status changed from assigned to closed
  • Resolution set to worksforme

I noticed that the failure happen on QT template members that potentially should be "inline" ( detachInternal in qvaluelist.h ).
I added below line to the top CMakeLists.txt at the location you previously suggested and the code can compile and does work :)

......
ADD_DEFINITIONS("-DQ_INLINE_TEMPLATES=inline")
......

My QT installion doesn't define "Q_INLINE_TEMPLATES" to inline, not sure whether it should, in the QT include qglobal.h it seems not defined to "inline" for GNU compilers.

So this doesn't seem to be a kdesvn defect after all, more likely a problem with my installation or QT 3.3.8.

comment:7 Changed 6 years ago by alwin

  • Milestone not applicable deleted
View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.

Ihr Browser versucht gerade eine Seite aus dem sogenannten Internet auszudrucken. Das Internet ist ein weltweites Netzwerk von Computern, das den Menschen ganz neue Möglichkeiten der Kommunikation bietet.

Da Politiker im Regelfall von neuen Dingen nichts verstehen, halten wir es für notwendig, sie davor zu schützen. Dies ist im beidseitigen Interesse, da unnötige Angstzustände bei Ihnen verhindert werden, ebenso wie es uns vor profilierungs- und machtsüchtigen Politikern schützt.

Sollten Sie der Meinung sein, dass Sie diese Internetseite dennoch sehen sollten, so können Sie jederzeit durch normalen Gebrauch eines Internetbrowsers darauf zugreifen. Dazu sind aber minimale Computerkenntnisse erforderlich. Sollten Sie diese nicht haben, vergessen Sie einfach dieses Internet und lassen uns in Ruhe.

Die Umgehung dieser Ausdrucksperre ist nach §95a UrhG verboten.

Mehr Informationen unter www.politiker-stopp.de.