Mailinglist Archive: opensuse-packaging (232 mails)

< Previous Next >
Re: [opensuse-packaging] Need gcc / makefile / autotools help with a new python/C package
  • From: Nelson Marques <nmo.marques@xxxxxxxxx>
  • Date: Mon, 13 Feb 2012 22:15:20 +0000
  • Message-id: <>
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,


2012/2/13 Nelson Marques <nmo.marques@xxxxxxxxx>:

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.


2012/2/13 Greg Freemyer <greg.freemyer@xxxxxxxxx>:

As I've blasted across the universe, I'm trying to package a set of
computer forensic apps.

I'm tracking my progress here.

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.c .libs/pypacket.a -lpthread -ldl
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]
/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
(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?


Nelson Marques

  nmo.marques@xxxxxxxxx */

Nelson Marques

  nmo.marques@xxxxxxxxx */
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx

< Previous Next >