Results 1 to 3 of 3
Hello all, I have an 32bit application and I try to port it to 64bit by recompiling it on a 64 bit Redhat 5.4. But I get these error messages. ...
- 07-22-2010 #1Just Joined!
- Join Date
- Mar 2006
- Posts
- 25
Port 32 bit application to 64bit.
Hello all, I have an 32bit application and I try to port it to 64bit by recompiling it on a 64 bit Redhat 5.4. But I get these error messages. Could you please show me some light on this? Your help is much appreciated. Thank you.
g++ -c -Wall -Wno-unknown-pragmas -fpermissive -fPIC -DUNIX -DDLG_UNIX_OS -DDLG_LINUX_OS -D_GNU_SOURCE -Dx86_64 -DNDEBUG -O2 -DLIBRTFMT_EXPORTS -m64 -I. -I./../../../../components/include -I./../../../../import/include/unix -I./../../../../import/include -I./../../../../include/external/unix -I./../../../../include/external -I./../../../../include/internal/unix -I./../../../../include/internal -I./ -I../MemoryStream -I../Messages -I../PerformanceCounter -I../RtfANSIAPI -I../RtfConfigFileReader -I../RtfService -I../Serialization -I../ServiceMonitor -I../Settings -I../Support -I../Tinyxml -I../TraceConfig -I../TraceData -I../TraceFiltering -I../TraceService -I../RtfDataTextExporter -I../MultiFileStream -o./../../../../build/objs/unix/gcc4.1.2/release/librtfmt.o librtfmt.cpp
../Serialization/Serialization.h:112: warning: class Serializer has virtual functions but non-virtual destructor
../Serialization/Serialization.h:140: warning: class Deserializer has virtual functions but non-virtual destructor
../ServiceMonitor/ServiceMonitor.h:259: warning: class WatchServiceStartUsingPIDFile has virtual functions but non-virtual destructor
../ServiceMonitor/ServiceMonitor.h:359: warning: class WatchServiceStopUsingPID has virtual functions but non-virtual destructor
../RtfConfigFileReader/RtfConfigFileReader.h:50: warning: class BaseConfigProcessor has virtual functions but non-virtual destructor
../RtfService/RtfConfigProcessor.h:176: warning: class RtfServerConfigProcessor has virtual functions but non-virtual destructor
../RtfService/RtfRecordSequencegenerator.h: In member function long unsigned int RtfRecordSequenceGenerator::operator++(int):
../RtfService/RtfRecordSequencegenerator.h:56: warning: dereferencing type-punned pointer will break strict-aliasing rules
../MultiFileStream/MultiFileStream.h: In constructor MultiFileOutputStream<SupportClass, HeaderSize>::MultiFileOutputStream(const std::string&, const std::string&, const std::string&, bool, size_t, size_t, size_t, size_t):
../MultiFileStream/MultiFileStream.h:331: warning: there are no arguments to GetHeader that depend on a template parameter, so a declaration of GetHeader must be available
../MultiFileStream/MultiFileStream.h: In member function void MultiFileInputStream<SupportClass, HeaderSize>::GetAllLogFiles(const std::string&, const std::string&, const std::string&, const std::string&):
../MultiFileStream/MultiFileStream.h:574: warning: there are no arguments to GetHeader that depend on a template parameter, so a declaration of GetHeader must be available
../TraceData/TraceDataReader.h: At global scope:
../TraceData/TraceDataReader.h:273: warning: specialization of template<class _Tp> struct std::greater in different namespace
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_function.h:214: warning: from definition of template<class _Tp> struct std::greater
../RtfService/RtfConfigProcessor.h: In instantiation of RtfClientConfigProcessor<RtfFilterManager>:
../RtfService/RtfServiceClient.h:82: instantiated from here
../RtfService/RtfConfigProcessor.h:43: warning: class RtfClientConfigProcessor<RtfFilterManager> has virtual functions but non-virtual destructor
../RtfANSIAPI/RtfANSIAPI.h: In function int RtfTraceEnabledEx(MODULEHANDLE, CLIENTHANDLE, LABELHANDLE):
../RtfANSIAPI/RtfANSIAPI.h:826: warning: Filter.RtfFilter::m_ModuleName may be used uninitialized in this function
../RtfANSIAPI/RtfANSIAPI.h:826: warning: Filter.RtfFilter::m_ClientName may be used uninitialized in this function
../RtfANSIAPI/RtfANSIAPI.h:826: warning: Filter.RtfFilter::m_LabelName may be used uninitialized in this function
/tmp/ccKzCY8W.s: Assembler messages:
/tmp/ccKzCY8W.s:37608: Error: Incorrect register `%rax' used with `l' suffix
/tmp/ccKzCY8W.s:38168: Error: Incorrect register `%rax' used with `l' suffix
/tmp/ccKzCY8W.s:38890: Error: Incorrect register `%rax' used with `l' suffix
/tmp/ccKzCY8W.s:39464: Error: Incorrect register `%rax' used with `l' suffix
/tmp/ccKzCY8W.s:42406: Error: Incorrect register `%rax' used with `l' suffix
/tmp/ccKzCY8W.s:43575: Error: Incorrect register `%rax' used with `l' suffix
/tmp/ccKzCY8W.s:49270: Error: Incorrect register `%rax' used with `l' suffix
/tmp/ccKzCY8W.s:50221: Error: Incorrect register `%rax' used with `l' suffix
make: *** [../../../../build/objs/unix/gcc4.1.2/release/./librtfmt.o] Error 1
- 07-22-2010 #2Just Joined!
- Join Date
- Mar 2006
- Posts
- 25
Hello all, the problem was because the use of cmpxchgl, xchgl and xaddl in __asm__. I replaced cmpxchgl, xchgl, xaddl with cmpxchg, xchg, xadd and it compiled fine now. The question now is why cmpxchgl, xchgl, xaddl cannot be used to compile code on 64bit environment? Thank you.
Does not compile on 64 bit environment:
void *lock( void **dest, void *val )
{
void *ret;
__asm__ ( "lock; xchgl %0,(%1)"
: "=r" (ret) : "r" (dest), "0" (val) : "memory" );
return ret;
}
Compiles on 64 bit environment:
void *lock( void **dest, void *val )
{
void *ret;
__asm__ ( "lock; xchg %0,(%1)"
: "=r" (ret) : "r" (dest), "0" (val) : "memory" );
return ret;
}
- 07-23-2010 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
My guess is that the trailing 'l' means that these are LONG instructions, which are the default for 64-bit operations. Hence the need to conditionally compile them without the 'l' for 64-bit systems.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote