[opensuse-packaging] Need gcc / makefile / autotools help with a new python/C package
All, As I've blasted across the universe, I'm trying to package a set of computer forensic apps. I'm tracking my progress here. http://en.opensuse.org/Portal:Digital_Forensics_/_Incident_Response The next one on my list is pyflag. I have a package in OBS: home:gregfreemyer:Tools-for-forensic-boot-cd > pyflag But the build is failing in the INSTALL section with: == gcc -shared -I/usr/include/python2.7 -I../../src/include -L -lpython2.7 -o pypacket.so pypacket.c .libs/pypacket.a -lpthread -ldl -lutil In file included from /usr/include/python2.7/Python.h:8:0, from ../../src/include/pypacket.h:4, from pypacket.c:8: /usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default] /usr/include/features.h:215:0: note: this is the location of the previous definition pypacket.c:323:5: warning: initialization from incompatible pointer type [enabled by default] pypacket.c:323:5: warning: (near initialization for 'PyPacketType.tp_getattr') [enabled by default] /usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: /tmp/ccHOtZu6.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC /tmp/ccHOtZu6.o: could not read symbols: Bad value collect2: ld returned 1 exit status == I have unpacked the tarball and manually done "./configure; make; make install" and I get the same error. If I cd into "pyflag-0.87-pre1/src/lib" and then do a make pypacket.so (which seems to be the goal of the above gcc command), I get the exact same error. So I'm in the right place, but I don't know how to debug this any further. I've attached the Makefile from pyflag-0.87-pre1/src/lib folder. Can anyone help me with that? Thanks Greg
Dude, The answer is quite simple, you need to add -fPIC to the compiler flags, then try again, see if it works ;) If it doesn't work, let us know, I'm sure we can go a bit further on this. NM 2012/2/13 Greg Freemyer <greg.freemyer@gmail.com>:
All,
As I've blasted across the universe, I'm trying to package a set of computer forensic apps.
I'm tracking my progress here.
http://en.opensuse.org/Portal:Digital_Forensics_/_Incident_Response
The next one on my list is pyflag. I have a package in OBS:
home:gregfreemyer:Tools-for-forensic-boot-cd > pyflag
But the build is failing in the INSTALL section with:
== gcc -shared -I/usr/include/python2.7 -I../../src/include -L -lpython2.7 -o pypacket.so pypacket.c .libs/pypacket.a -lpthread -ldl -lutil In file included from /usr/include/python2.7/Python.h:8:0, from ../../src/include/pypacket.h:4, from pypacket.c:8: /usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default] /usr/include/features.h:215:0: note: this is the location of the previous definition pypacket.c:323:5: warning: initialization from incompatible pointer type [enabled by default] pypacket.c:323:5: warning: (near initialization for 'PyPacketType.tp_getattr') [enabled by default] /usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: /tmp/ccHOtZu6.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC /tmp/ccHOtZu6.o: could not read symbols: Bad value collect2: ld returned 1 exit status ==
I have unpacked the tarball and manually done "./configure; make; make install" and I get the same error.
If I cd into "pyflag-0.87-pre1/src/lib" and then do a make pypacket.so (which seems to be the goal of the above gcc command), I get the exact same error.
So I'm in the right place, but I don't know how to debug this any further.
I've attached the Makefile from pyflag-0.87-pre1/src/lib folder.
Can anyone help me with that?
Thanks Greg
-- Nelson Marques /* http://www.marques.so nmo.marques@gmail.com */ -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
By the way... whenever you are building/compiling shared objects you should use -fPIC, and when you are building static stuff, make sure you never use -fPIC. Hope it helps, NM 2012/2/13 Nelson Marques <nmo.marques@gmail.com>:
Dude,
The answer is quite simple, you need to add -fPIC to the compiler flags, then try again, see if it works ;) If it doesn't work, let us know, I'm sure we can go a bit further on this.
NM
2012/2/13 Greg Freemyer <greg.freemyer@gmail.com>:
All,
As I've blasted across the universe, I'm trying to package a set of computer forensic apps.
I'm tracking my progress here.
http://en.opensuse.org/Portal:Digital_Forensics_/_Incident_Response
The next one on my list is pyflag. I have a package in OBS:
home:gregfreemyer:Tools-for-forensic-boot-cd > pyflag
But the build is failing in the INSTALL section with:
== gcc -shared -I/usr/include/python2.7 -I../../src/include -L -lpython2.7 -o pypacket.so pypacket.c .libs/pypacket.a -lpthread -ldl -lutil In file included from /usr/include/python2.7/Python.h:8:0, from ../../src/include/pypacket.h:4, from pypacket.c:8: /usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default] /usr/include/features.h:215:0: note: this is the location of the previous definition pypacket.c:323:5: warning: initialization from incompatible pointer type [enabled by default] pypacket.c:323:5: warning: (near initialization for 'PyPacketType.tp_getattr') [enabled by default] /usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: /tmp/ccHOtZu6.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC /tmp/ccHOtZu6.o: could not read symbols: Bad value collect2: ld returned 1 exit status ==
I have unpacked the tarball and manually done "./configure; make; make install" and I get the same error.
If I cd into "pyflag-0.87-pre1/src/lib" and then do a make pypacket.so (which seems to be the goal of the above gcc command), I get the exact same error.
So I'm in the right place, but I don't know how to debug this any further.
I've attached the Makefile from pyflag-0.87-pre1/src/lib folder.
Can anyone help me with that?
Thanks Greg
-- Nelson Marques
/* http://www.marques.so nmo.marques@gmail.com */
-- Nelson Marques /* http://www.marques.so nmo.marques@gmail.com */ -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On 13/02/12 19:08, Greg Freemyer wrote:
All,
As I've blasted across the universe, I'm trying to package a set of computer forensic apps.
I'm tracking my progress here.
http://en.opensuse.org/Portal:Digital_Forensics_/_Incident_Response
The next one on my list is pyflag. I have a package in OBS:
home:gregfreemyer:Tools-for-forensic-boot-cd> pyflag
But the build is failing in the INSTALL section with:
== gcc -shared -I/usr/include/python2.7 -I../../src/include -L -lpython2.7 -o pypacket.so pypacket.c .libs/pypacket.a -lpthread -ldl -lutil In file included from /usr/include/python2.7/Python.h:8:0, from ../../src/include/pypacket.h:4,
Upstream autotools usage is messed up, I will send you a patch :-) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Mon, Feb 13, 2012 at 6:26 PM, Cristian Rodríguez <crrodriguez@opensuse.org> wrote:
On 13/02/12 19:08, Greg Freemyer wrote:
All,
As I've blasted across the universe, I'm trying to package a set of computer forensic apps.
I'm tracking my progress here.
http://en.opensuse.org/Portal:Digital_Forensics_/_Incident_Response
The next one on my list is pyflag. I have a package in OBS:
home:gregfreemyer:Tools-for-forensic-boot-cd> pyflag
But the build is failing in the INSTALL section with:
== gcc -shared -I/usr/include/python2.7 -I../../src/include -L -lpython2.7 -o pypacket.so pypacket.c .libs/pypacket.a -lpthread -ldl -lutil In file included from /usr/include/python2.7/Python.h:8:0, from ../../src/include/pypacket.h:4,
Upstream autotools usage is messed up, I will send you a patch :-)
Thanks, and glad to hear it. I've been looking at it and just getting confused. If I just need to patch -fPIC on to the end of this rule: %.so: %.c $(CC) -shared $(AM_CFLAGS) $(PYTHON_CPPFLAGS) -I$(top_srcdir)/src/include $(PYTHON_LDFLAGS) -o $@ $? .libs/$*.a $(PYTHON_EXTRA_LIBS) $(AM_LDFLAGS) I can figure out the patch, there are several Makefile.in files that have that rule, but knowing that doing that is right would give me confidence to proceed. Greg -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On 13/02/12 20:29, Greg Freemyer wrote:
On Mon, Feb 13, 2012 at 6:26 PM, Cristian Rodríguez <crrodriguez@opensuse.org> wrote:
On 13/02/12 19:08, Greg Freemyer wrote:
All,
As I've blasted across the universe, I'm trying to package a set of computer forensic apps.
I'm tracking my progress here.
http://en.opensuse.org/Portal:Digital_Forensics_/_Incident_Response
The next one on my list is pyflag. I have a package in OBS:
home:gregfreemyer:Tools-for-forensic-boot-cd> pyflag
But the build is failing in the INSTALL section with:
== gcc -shared -I/usr/include/python2.7 -I../../src/include -L -lpython2.7 -o pypacket.so pypacket.c .libs/pypacket.a -lpthread -ldl -lutil In file included from /usr/include/python2.7/Python.h:8:0, from ../../src/include/pypacket.h:4,
Upstream autotools usage is messed up, I will send you a patch :-)
Thanks, and glad to hear it. I've been looking at it and just getting confused.
If I just need to patch -fPIC on to the end of this rule:
%.so: %.c $(CC) -shared $(AM_CFLAGS) $(PYTHON_CPPFLAGS) -I$(top_srcdir)/src/include $(PYTHON_LDFLAGS) -o $@ $? .libs/$*.a $(PYTHON_EXTRA_LIBS) $(AM_LDFLAGS)
No, those are autogenerated by automake, I will send an SR to your project .. Im currently cleaning up the mess ^_^ -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
If I just need to patch -fPIC on to the end of this rule:
%.so: %.c $(CC) -shared $(AM_CFLAGS) $(PYTHON_CPPFLAGS) -I$(top_srcdir)/src/include $(PYTHON_LDFLAGS) -o $@ $? .libs/$*.a $(PYTHON_EXTRA_LIBS) $(AM_LDFLAGS)
No, those are autogenerated by automake, I will send an SR to your project .. Im currently cleaning up the mess ^_^
Fantastic. I'm sure you noticed I had a BuildRequires wrong in my home: project. It should have been: BuildRequires: afflib-devel BuildRequires: libewf-devel I was working locally and just hadn't fixed the typo at OBS I submitted without testing. FYI: I knew that was the wrong place to patch, but it was the only way I figured out how to do it. And when you said it was a autotools bug, I thought maybe it wasn't such a bad idea after all to just patch the intermediary file. Greg -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Mon, Feb 13, 2012 at 7:39 PM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
If I just need to patch -fPIC on to the end of this rule:
%.so: %.c $(CC) -shared $(AM_CFLAGS) $(PYTHON_CPPFLAGS) -I$(top_srcdir)/src/include $(PYTHON_LDFLAGS) -o $@ $? .libs/$*.a $(PYTHON_EXTRA_LIBS) $(AM_LDFLAGS)
No, those are autogenerated by automake, I will send an SR to your project .. Im currently cleaning up the mess ^_^
Fantastic.
I'm sure you noticed I had a BuildRequires wrong in my home: project.
It should have been: BuildRequires: afflib-devel BuildRequires: libewf-devel
I was working locally and just hadn't fixed the typo at OBS I submitted without testing.
FYI: I knew that was the wrong place to patch, but it was the only way I figured out how to do it. And when you said it was a autotools bug, I thought maybe it wasn't such a bad idea after all to just patch the intermediary file.
Greg
Christian, Did you ever make any progress. I updated the specfile in OBS in a couple trivial ways so the package in my home now fails the same way as my local build. Hopefully that propagated to your copy and you have these 3 lines in the specfile. # pyflag is currently looking for afflib.h in /usr/include. It's in /usr/include/afflib. FIX # BuildRequires: afflib-devel BuildRequires: libewf-devel Thanks again for looking at this. Greg -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Thu, Feb 23, 2012 at 6:15 PM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
On Mon, Feb 13, 2012 at 7:39 PM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
If I just need to patch -fPIC on to the end of this rule:
%.so: %.c $(CC) -shared $(AM_CFLAGS) $(PYTHON_CPPFLAGS) -I$(top_srcdir)/src/include $(PYTHON_LDFLAGS) -o $@ $? .libs/$*.a $(PYTHON_EXTRA_LIBS) $(AM_LDFLAGS)
No, those are autogenerated by automake, I will send an SR to your project .. Im currently cleaning up the mess ^_^
Fantastic.
I'm sure you noticed I had a BuildRequires wrong in my home: project.
It should have been: BuildRequires: afflib-devel BuildRequires: libewf-devel
I was working locally and just hadn't fixed the typo at OBS I submitted without testing.
FYI: I knew that was the wrong place to patch, but it was the only way I figured out how to do it. And when you said it was a autotools bug, I thought maybe it wasn't such a bad idea after all to just patch the intermediary file.
Greg
Christian,
Did you ever make any progress. I updated the specfile in OBS in a couple trivial ways so the package in my home now fails the same way as my local build.
Hopefully that propagated to your copy and you have these 3 lines in the specfile.
# pyflag is currently looking for afflib.h in /usr/include. It's in /usr/include/afflib. FIX # BuildRequires: afflib-devel BuildRequires: libewf-devel
Thanks again for looking at this. Greg
ping. I noticed the branch you had made disappeared recently. Part of the clean-up? Greg -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
El 20/03/12 11:12, Greg Freemyer escribió:
ping.
I noticed the branch you had made disappeared recently. Part of the clean-up?
Yes, it went away, I have not completed the fix there though. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (3)
-
Cristian Rodríguez
-
Greg Freemyer
-
Nelson Marques