gcc -shared build/temp.solaris-2.7-sun4u-2.2/_mysql.o -L/homes/nj/colman/lib/mysql -Wl,-R/homes/nj/colman/lib:/homes/nj/colman/lib/mysql:/usr/local/lib:/usr/openwin/lib:/usr/dt/lib -lmysqlclient -lz -o build/lib.solaris-2.7-sun4u-2.2/_mysql.so
Text relocation remains referenced
against symbol offset in file
<unknown> 0x7bc /homes/nj/colman/lib/mysql/libmysqlclient.a(libmysql.o)
<unknown> 0x7c0 /homes/nj/colman/lib/mysql/libmysqlcl
...
...
...
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There are some casts to (PyObject *) on those lines. They are needed to above some other warnings on my setup, but perhaps you could try removing them to see what they do on yours. I expect they will only change the warnings.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can anyone help me with the above problem? Has anyone seen this problem before? I'm behind the 8-ball here on a project I need to do that requires this package. Any help would be greatly appreciated!
Thanks!
...Jake
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This results in new compiler warning but the same linker errors.
_mysql.c: In function `_escape_item':
_mysql.c:741: warning: passing arg 2 of `PyObject_GetItem' from incompatible pointer type
_mysql.c: In function `init_mysql':
_mysql.c:2373: warning: passing arg 3 of `PyDict_SetItemString' from incompatible pointer type
_mysql.c:2378: warning: passing arg 3 of `PyDict_SetItemString' from incompatible pointer type
So where do we go from here?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The warnings went away but the linker problems remain.
BTW I edited "extra_compile_args.append" to include the compiler option and the build failed with an "unrecognized option" error. I copied/pasted the gcc command-line and it compiled fine. I then reexecuted 'python setup.py build' and it went straight to the link step and gave me the same errors as before.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It looks like the solution is to use the GNU ld instead of the Solaris /usr/ccs/bin/ld. Unfortunately I don't have an easy way of doing this on Solaris 9.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Bingo! I downloaded gnu binutils and installed. I reconfigured gcc to use gnu ld and gnu as, pointing it at the installed location of binutils. I rebuilt gcc, python, and the mySqlDB extension and all is well! Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am using gcc 3.3 on sparc-solaris-7 with Python 2.2.3 and mySql 4.0.13. I am getting link errors when I try building MySqlDB. Can anyone help?
Not without error messages.
Here is what I am getting:
gcc -shared build/temp.solaris-2.7-sun4u-2.2/_mysql.o -L/homes/nj/colman/lib/mysql -Wl,-R/homes/nj/colman/lib:/homes/nj/colman/lib/mysql:/usr/local/lib:/usr/openwin/lib:/usr/dt/lib -lmysqlclient -lz -o build/lib.solaris-2.7-sun4u-2.2/_mysql.so
Text relocation remains referenced
against symbol offset in file
<unknown> 0x7bc /homes/nj/colman/lib/mysql/libmysqlclient.a(libmysql.o)
<unknown> 0x7c0 /homes/nj/colman/lib/mysql/libmysqlcl
...
...
...
ld: fatal: relocations remain against allocatable but non-writable sections
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
You left out the compile line, so I can't tell if you are using -fPIC or not. setup.py does this:
elif sys.platform == "sunos5": # Solaris 2.8 + gcc
runtime_library_dirs.append('/usr/local/lib:/usr/openwin/lib:/usr/dt/lib')
extra_compile_args.append("-fPIC")
I seem to recally this flag was specifically for this problem. So, what is your value of sys.platform?
Also please try MySQL-python-0.9.3a1.
Yes, I am using the -fPIC option and have tried this with both 0.9.2 and 0.9.3a1.
I deleted the .o file so that I can show you the compile statement, the compile results and the linker output.
building '_mysql' extension
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/homes/nj/colman/include/mysql -I/homes/nj/colman/include/python2.2 -c _mysql.c -o build/temp.solaris-2.7-sun4u-2.2/_mysql.o -fPIC
_mysql.c: In function `_escape_item':
_mysql.c:740: warning: dereferencing type-punned pointer will break strict-aliasing rules
_mysql.c: In function `init_mysql':
_mysql.c:2371: warning: dereferencing type-punned pointer will break strict-aliasing rules
_mysql.c:2375: warning: dereferencing type-punned pointer will break strict-aliasing rules
gcc -shared build/temp.solaris-2.7-sun4u-2.2/_mysql.o -L/homes/nj/colman/lib/mysql -Wl,-R/homes/nj/colman/lib:/homes/nj/colman/lib/mysql:/usr/local/lib:/usr/openwin/lib:/usr/dt/lib -lmysqlclient -lz -o build/lib.solaris-2.7-sun4u-2.2/_mysql.so
Text relocation remains referenced
against symbol offset in file
<unknown> 0x7bc /homes/nj/colman/lib/mysql/libmysqlclient.a(libmysql.o)
<unknown> 0x7c0 /homes/nj/colman/lib/mysql/libmysqlcl
There are some casts to (PyObject *) on those lines. They are needed to above some other warnings on my setup, but perhaps you could try removing them to see what they do on yours. I expect they will only change the warnings.
Can anyone help me with the above problem? Has anyone seen this problem before? I'm behind the 8-ball here on a project I need to do that requires this package. Any help would be greatly appreciated!
Thanks!
...Jake
This results in new compiler warning but the same linker errors.
_mysql.c: In function `_escape_item':
_mysql.c:741: warning: passing arg 2 of `PyObject_GetItem' from incompatible pointer type
_mysql.c: In function `init_mysql':
_mysql.c:2373: warning: passing arg 3 of `PyDict_SetItemString' from incompatible pointer type
_mysql.c:2378: warning: passing arg 3 of `PyDict_SetItemString' from incompatible pointer type
So where do we go from here?
Read http://mail.gnu.org/archive/html/discuss-gnustep/2003-05/msg00418.html and try adding -fno-strict-aliasing to extra_compiler_flags in the Solaris portion of setup.py.
The warnings went away but the linker problems remain.
BTW I edited "extra_compile_args.append" to include the compiler option and the build failed with an "unrecognized option" error. I copied/pasted the gcc command-line and it compiled fine. I then reexecuted 'python setup.py build' and it went straight to the link step and gave me the same errors as before.
I am having the same problem on Solaris 9.
I found this reference http://aspn.activestate.com/ASPN/Mail/Message/python-dev/798432
which appears to describe the same problem.
It looks like the solution is to use the GNU ld instead of the Solaris /usr/ccs/bin/ld. Unfortunately I don't have an easy way of doing this on Solaris 9.
Bingo! I downloaded gnu binutils and installed. I reconfigured gcc to use gnu ld and gnu as, pointing it at the installed location of binutils. I rebuilt gcc, python, and the mySqlDB extension and all is well! Thanks!