help-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc command works, GnuStep makefile fails


From: David Ayers
Subject: Re: gcc command works, GnuStep makefile fails
Date: Mon, 28 Mar 2005 14:58:21 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217

Sergei Gnezdov wrote:
The following command compiles a simple Hello world program (yes, I
want to include mysql):

gcc Source.m -lobjc -lpthread -lmysqlclient -lz -L/usr/local/lib/mysql

The following GNUmakefile compiles the same file, but application
crashes.  It started to crash, when I added mysql to GNUmakefile:

-----
include ${GNUSTEP_MAKEFILES}/common.make

ADDITIONAL_OBJCFLAGS= -Wno-import -Wall

TOOL_NAME = app
app_OBJC_FILES = Source.m
app_INCLUDE_DIRS = -I/usr/local/include/mysql
app_TOOL_LIBS = -lecgi -lmysqlclient -lz
app_LIB_DIRS = -L/usr/local/lib/mysql

include ${GNUSTEP_MAKEFILES}/tool.make
-----

Error message:

Bus error (core dumped)

Another problem is that I have no clue what kind of command line
GNUmakefile generates.

I had a similar crash with mysqlclient. My problem was, that libobjc and libmysqlclient both export hash_next functions and the libobjc was calling into the mysql version during class initialization. You could either "work around" this by ordering the linked libraries in way that happens to work (I don't know whether this can be done with gnustep-make) or you can try creating another C wrapper library for mysqlclient and avoid linking -lobjc and -lmysqlclient in the same executable which seems to work around the issue for us currently.

GCC 4.0 will call new objc_ prefixed hash functions but even 4.1 will probably still have the original version for binary compatibility, so you still run the risk that the mysqlclient may call into the objc version :-/.

If you have the possibility of building your own libobjc then you could apply similar patches and remove the non-prefixed versions.

For more information see:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19024

Cheers,
David Ayers




reply via email to

[Prev in Thread] Current Thread [Next in Thread]