Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'REG_EIP' undeclared #3

Closed
hasse69 opened this issue Mar 13, 2015 · 12 comments
Closed

'REG_EIP' undeclared #3

hasse69 opened this issue Mar 13, 2015 · 12 comments

Comments

@hasse69
Copy link
Owner

hasse69 commented Mar 13, 2015

i defined and tried 2 diffrent versions of fusefs (fuse-2.8.0,fuse-2.8.5)
but im getting always this error:
make
g++ -g -rdynamic -fno-omit-frame-pointer -O2  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DRARDLL  -MD -I./unrar -c dllext.cpp
gcc -g -rdynamic -fno-omit-frame-pointer -O2 -std=c99 -Wall  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DHAS_GLIBC_CUSTOM_STREAMS_ -DRARDLL -DFUSE_USE_VERSION=27 -I/root/fuse-2.8.0/include -MD -I./unrar -I/root/fuse-2.8.0/include -c configdb.c
gcc -g -rdynamic -fno-omit-frame-pointer -O2 -std=c99 -Wall  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DHAS_GLIBC_CUSTOM_STREAMS_ -DRARDLL -DFUSE_USE_VERSION=27 -I/root/fuse-2.8.0/include -MD -I./unrar -I/root/fuse-2.8.0/include -c filecache.c
gcc -g -rdynamic -fno-omit-frame-pointer -O2 -std=c99 -Wall  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DHAS_GLIBC_CUSTOM_STREAMS_ -DRARDLL -DFUSE_USE_VERSION=27 -I/root/fuse-2.8.0/include -MD -I./unrar -I/root/fuse-2.8.0/include -c iobuffer.c
gcc -g -rdynamic -fno-omit-frame-pointer -O2 -std=c99 -Wall  -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DHAS_GLIBC_CUSTOM_STREAMS_ -DRARDLL -DFUSE_USE_VERSION=27 -I/root/fuse-2.8.0/include -MD -I./unrar -I/root/fuse-2.8.0/include -c sighandler.c
sighandler.c: In function 'stack_trace':
sighandler.c:59: error: 'REG_EIP' undeclared (first use in this function)
sighandler.c:59: error: (Each undeclared identifier is reported only once
sighandler.c:59: error: for each function it appears in.)
make: *** [sighandler.o] Error 1

Original issue reported on code.google.com by pingu5400 on 2011-05-29

@hasse69 hasse69 self-assigned this Mar 13, 2015
@hasse69 hasse69 closed this as completed Mar 13, 2015
@hasse69 hasse69 removed their assignment Mar 13, 2015
@hasse69
Copy link
Owner Author

hasse69 commented Apr 29, 2015

This problem should be fixed in sighandler.c revision 190.
Download latest version from trunk to obtain the fix.

Original issue reported on code.google.com by hasse69 on 2011-05-29 16:30:54

@hasse69
Copy link
Owner Author

hasse69 commented Apr 29, 2015

ok that seems to work, but now it has an new problem:

gcc -g -rdynamic -fno-omit-frame-pointer -O2 -std=c99 -Wall  -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE  -DRARDLL -DFUSE_USE_VERSION=27
-I/root/fuse-2.8.0/include -MD -I./unrar -I/root/fuse-2.8.0/include -c rar2fs.c
rar2fs.c: In function 'extract_to':
rar2fs.c:206: warning: cast to pointer from integer of different size
rar2fs.c: In function 'popen_':
rar2fs.c:352: warning: cast to pointer from integer of different size
rar2fs.c: In function 'getArcPassword':
rar2fs.c:1055: warning: cast to pointer from integer of different size
gcc -o rar2fs  dllext.o configdb.o filecache.o iobuffer.o sighandler.o rar2fs.o -L/root/fuse-2.8.0/lib
-lunrar -pthread -lfuse
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot
find -lunrar
collect2: ld returned 1 exit status
make: *** [rar2fs] Error 1

Original issue reported on code.google.com by pingu5400 on 2011-05-29 17:18:51

@hasse69
Copy link
Owner Author

hasse69 commented Apr 29, 2015

Check your config.mk.
If libunrar.so can not be found in your systems library path you need to point to the
folder yourself in UNRAR_LIB.
The warnings you can leave aside. It is because your system is probably 64-bit. I might
clean this up later.
Also remember, you should probably build libunrar.so yourself from the libunrar package
since latest version of rar2fs requires the libunrar 4.0.7.
Enter the unrar folder and do 'make -f makefile.unix lib'. Double check the makefile.unix
for your platform and make sure -O2 is enabled for performance.

Original issue reported on code.google.com by hasse69 on 2011-05-29 17:30:39

@hasse69
Copy link
Owner Author

hasse69 commented Apr 29, 2015

ah oh but it doesnt work now

gcc -o rar2fs  dllext.o configdb.o filecache.o iobuffer.o sighandler.o rar2fs.o -L./unrar/
-L/root/fuse-2.8.0/lib -lunrar -pthread -lfuse
./unrar//libunrar.so: undefined reference to `RecVolumes::~RecVolumes()'
./unrar//libunrar.so: undefined reference to `RecVolumes::Restore(RAROptions*, char
const*, wchar_t const*, bool)'
./unrar//libunrar.so: undefined reference to `RecVolumes::RecVolumes()'
collect2: ld returned 1 exit status
make: *** [rar2fs] Error 1

Original issue reported on code.google.com by pingu5400 on 2011-05-29 20:47:26

@hasse69
Copy link
Owner Author

hasse69 commented Apr 29, 2015

Sounds like you need to make a clean build of rar2fs after you built your version of
libunrar.so (old symbol references were probably left in the C++ API extensions).

Try this in the rar2fs source folder and see if it helps:
> make clean; make

Original issue reported on code.google.com by hasse69 on 2011-05-29 21:13:30

@hasse69
Copy link
Owner Author

hasse69 commented Apr 29, 2015

i solved it, i compiled unrar on x64 with -fPIC flag because without it didnt compile
i had to add -fPIC also in the rar2fs makefile

Original issue reported on code.google.com by pingu5400 on 2011-05-30 10:47:23

@hasse69
Copy link
Owner Author

hasse69 commented Apr 29, 2015

Interesting. Very interesting. Excactly what platform are you running?
I thought that -fPIC only had a relevance on some specific machines and that most platforms
today default to position-independent code to make dynamic linking possible.

From the gcc man page:

-fPIC 
    If supported for the target machine, emit position-independent code, suitable for
dynamic linking and avoiding any limit on the size of the global offset table. This
option makes a difference on the m68k, PowerPC and SPARC.

    Position-independent code requires special support, and therefore works only on
certain machines. 


Original issue reported on code.google.com by hasse69 on 2011-05-30 11:19:05

@hasse69
Copy link
Owner Author

hasse69 commented Apr 29, 2015

Exactly what compilation error did you get for rar2fs if -fPIC was not specified ?
Generally you should not need -fPIC on the object files that are used to build the
binary unless they are also part of the shared lib itself! -fPIC is probaly required
for x32_64 platforms and 64-bit Linux ABI. But, -fPIC introduces a slight performace
penalty so you wish to avoid it if you can. In this case I think it should have been
enough with having -fPIC in the unrar makefile.

Original issue reported on code.google.com by hasse69 on 2011-05-30 12:08:30

@hasse69
Copy link
Owner Author

hasse69 commented Apr 29, 2015

strange not it works without fpic after recompiling gcc

Original issue reported on code.google.com by pingu5400 on 2011-05-31 11:31:13

@hasse69
Copy link
Owner Author

hasse69 commented Apr 29, 2015

After recompiling gcc ?
What version off gcc did you use before and after it works without -fPIC?
Could you clean+build the libunrar.so shared library without -fPIC with a later version
of gcc ?

Original issue reported on code.google.com by hasse69 on 2011-05-31 11:43:42

@hasse69
Copy link
Owner Author

hasse69 commented Apr 29, 2015

>Could you clean+build the libunrar.so shared library without -fPIC with a later version
of gcc ?
yes i could
i use gentoo x64, may have had diffrent use flags the last compile of gcc

Original issue reported on code.google.com by pingu5400 on 2011-06-01 16:14:39

@hasse69
Copy link
Owner Author

hasse69 commented Apr 29, 2015

Ok, that sounds great.
But, as I see it, the important thing here is that you seem to have solved your initial
problems with buidling rar2fs :)
I will keep a eye on this issue and if I receive more reports related to -fPIC there
might be a need for at least some FAQ entry.

Case closed.

Original issue reported on code.google.com by hasse69 on 2011-06-01 20:47:23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant