Hi David, On Mon, Jul 23, 2012 at 02:24:43PM +0100, David Chisnall wrote: > On 22 Jul 2012, at 19:49, Philippe Roussel wrote: > > > I tried to use libobjc2, and did a preliminary debianization, but ran > > into linking errors when using gcc 4.7 and didn't investigate much > > Please let me know what these are. I have not used gcc 4.7, because > it is not able to compile most of my Objective-C code.
I'm not sure this is related to gcc 4.7 but I'm still having problems building gnustep base. Here's what I did on a 'clean' (no gnustep) 64 bits system. I'm trying to build libobjc2 and then gnustep, instead of the old gnustep make/libobjc2/gnustep make again thing, as it would allow me to simply build debian packages based on libobjc2. > philou@wheezy-64:~$ gcc -v > Using built-in specs. > COLLECT_GCC=gcc > COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper > Target: x86_64-linux-gnu > Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.1-2' > --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs > --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr > --program-suffix=-4.7 --enable-shared --enable-linker-build-id > --with-system-zlib --libexecdir=/usr/lib --without-included-gettext > --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 > --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu > --enable-libstdcxx-debug --enable-libstdcxx-time=yes > --enable-gnu-unique-object --enable-plugin --enable-objc-gc > --with-arch-32=i586 --with-tune=generic --enable-checking=release > --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu > Thread model: posix > gcc version 4.7.1 (Debian 4.7.1-2) I built and installed libobjc2 from svn trunk to /usr/local with make -f Makefile install I didn't use --with-objc-lib-flag when configuring gnustep make, maybe I should have. Next step, configuring gnustep base with a simple ./configure and got this in config.mak > WHOAMI=/usr/bin/whoami > > DYNAMIC_LINKER=simple > > HAVE_LIBXML=1 > HAVE_GNUTLS=1 > HAVE_BLOCKS=1 > > WITH_FFI=libffi > > NX_CONST_STRING_CLASS=NSConstantString > OBJCFLAGS+= -fgnu-runtime > OBJC2RUNTIME=1 > OBJCSYNC=1 > WARN_FLAGS=-Wall -Wdeclaration-after-statement > > HAVE_INET_PTON=yes > HAVE_INET_NTOP=yes > HAVE_OBJC_SYNC_ENTER=yes > > CONFIG_SYSTEM_INCL += -I/usr/local/include -I/usr/local/include > -I/usr/local/include -I/usr/local/include -I/usr/include/libxml2 > -I/usr/include/p11-kit-1 > ifeq ($(shared),yes) > CONFIG_SYSTEM_LIBS += -lgnutls -lgcrypt -L/usr/lib -lxml2 -lffi -lnsl > -lrt -ldl -lpthread -lz -licui18n -licuuc -licudata > CONFIG_SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/local/lib > -L/usr/local/lib -L/usr/local/lib/gnu-gnu-gnu -L/usr/local/lib > -L/usr/lib/x86_64-linux-gnu > endif > > GNUSTEP_INSTALL_GDOMAP_AS_SETUID=no > GNUSTEP_GDOMAP_PORT_OVERRIDE=no > > GNUSTEP_BASE_HAVE_LIBXML=1 > GNUSTEP_BASE_HAVE_GNUTLS=1 > GNUSTEP_BASE_HAVE_MDNS=0 > GNUSTEP_BASE_HAVE_AVAHI=0 > GNUSTEP_BASE_HAVE_ICU=1 > GNUSTEP_BASE_HAVE_LIBDISPATCH=0 > > # Futureproofing ... if we ever use non-ascii string constants in base, > # we need to make sure that anyone building base uses the expected input > # characterset > AUXILIARY_OBJCFLAGS += -finput-charset=UTF-8 ... and this in base.make > ifeq ($(BASE_MAKE_LOADED),) > BASE_MAKE_LOADED=yes > > ifeq ($(FOUNDATION_LIB),gnu) > # > # FIXME - macro names > # > AUXILIARY_OBJCFLAGS += -fconstant-string-class=NSConstantString > ifeq ($(shared),no) > CONFIG_SYSTEM_LIBS += -lgnutls -lgcrypt -L/usr/lib -lxml2 -lffi > -lnsl -lrt -ldl -lpthread -lz -licui18n > -licuuc -licudata > CONFIG_SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/local/lib > -L/usr/local/lib -L/usr/local/lib/gnu-gnu-gnu -L/u > sr/local/lib -L/usr/lib/x86_64-linux-gnu > endif > > GNUSTEP_BASE_VERSION = 1.24.2 > GNUSTEP_BASE_MAJOR_VERSION = 1 > GNUSTEP_BASE_MINOR_VERSION = 24 > GNUSTEP_BASE_SUBMINOR_VERSION = 2 > > FND_LDFLAGS = > FND_LIBS = -lgnustep-base > FND_DEFINE = -DGNUSTEP_BASE_LIBRARY=1 > GNUSTEP_DEFINE = -DGNUSTEP > else > # > # Not using the GNUstep foundation ... must be Apple's > # So we need to use the base additions library. > # > FND_LIBS = -lgnustep-baseadd -framework Foundation > endif > > # Is the ObjC2 runtime real or emulated? > # If it's not real, we need to use the emulation ObjectiveC2 headers. > OBJC2RUNTIME=1 > ifeq ($(OBJC2RUNTIME),0) > AUXILIARY_OBJCFLAGS += -I$(GNUSTEP_HEADERS)/ObjectiveC2 > AUXILIARY_CFLAGS += -I$(GNUSTEP_HEADERS)/ObjectiveC2 > endif > > # For literal string handling, base requires the compiler to store the > # string as UTF-8 > AUXILIARY_OBJCFLAGS += -fexec-charset=UTF-8 > > GNUSTEP_BASE_HAVE_GNUTLS=1 > GNUSTEP_BASE_HAVE_LIBXML=1 > GNUSTEP_BASE_HAVE_MDNS=0 > GNUSTEP_BASE_HAVE_AVAHI=0 > GNUSTEP_BASE_HAVE_UCI=@HAVE_UCI@ > > # If we determined that the Objective-C runtime does not support > # native Objective-C exceptions, turn them off. This overrides > # the USE_OBJC_EXCEPTIONS setting in gnustep-make's config.make. > ifeq (1, 0) > USE_OBJC_EXCEPTIONS = no > endif ... Building with make messages=yes stops with the following > gcc NSException.m -c \ > -MMD -MP -DGNUSTEP_TARGET_DIR=\".\" > -DGNUSTEP_TARGET_CPU=\"x86_64\" -DGNUSTEP_TARGET_OS=\"linux-gnu\" > -DGNUSTEP_IS_FLATTENED=\"yes\" -DLIBRARY_COMBO=\"gnu-gnu-gnu\" > -DGNUSTEP_BASE_INTERNAL=1 -Wall -Wdeclaration-after-statement -Wcast-align > -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 > -fno-strict-aliasing -fexceptions -fobjc-exceptions -D_NATIVE_OBJC_EXCEPTIONS > -pthread -fPIC -DDEBUG -fno-omit-frame-pointer -Wall -DGSWARN -DGSDIAGNOSE > -Wno-import -g -fgnu-runtime -fgnu-runtime > -fconstant-string-class=NSConstantString -fexec-charset=UTF-8 > -finput-charset=UTF-8 -I../Headers -I./. -I. -I/usr/local/include > -I/usr/local/include -I/usr/local/include -I/usr/local/include > -I/usr/include/libxml2 -I/usr/include/p11-kit-1 > -I/root/GNUstep/Library/Headers -I/usr/local/include \ > -o obj/libgnustep-base.obj/NSException.m.o > NSException.m: In function ‘+[NSException initialize]’: > NSException.m:813:3: error: ‘_objc_unexpected_exception’ undeclared (first > use in this function) > NSException.m:813:3: note: each undeclared identifier is reported only once > for each function it appears in > make[4]: *** [obj/libgnustep-base.obj/NSException.m.o] Erreur 1 If I change NSException.m with > Index: Source/NSException.m > =================================================================== > --- Source/NSException.m (révision 35400) > +++ Source/NSException.m (copie de travail) > @@ -39,9 +39,9 @@ > #import "Foundation/NSValue.h" > #import "GNUstepBase/NSString+GNUstepBase.h" > > -#ifdef __GNUSTEP_RUNTIME__ > +//#ifdef __GNUSTEP_RUNTIME__ > #include <objc/hooks.h> > -#endif > +//#endif > > #ifdef HAVE_SET_UNCAUGHT_EXCEPTION_HANDLER > #include <objc/objc-exception.h> the library is built and seems to be linked with the the libobjc : > /home/philou/gnustep/modules/core/base# ldd Source/obj/libgnustep-base.so > linux-vdso.so.1 => (0x00007fff59a62000) > libobjc.so.4 => /usr/local/lib/libobjc.so.4 (0x00007f72775c8000) > libgnutls.so.26 => /usr/lib/x86_64-linux-gnu/libgnutls.so.26 > (0x00007f72772f4000) > libgcrypt.so.11 => /lib/x86_64-linux-gnu/libgcrypt.so.11 > (0x00007f7277075000) > libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 > (0x00007f7276d16000) > libffi.so.5 => /usr/lib/x86_64-linux-gnu/libffi.so.5 > (0x00007f7276b09000) > libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f72768f0000) > librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f72766e8000) > libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f72764e4000) > libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 > (0x00007f72762c7000) > libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f72760b0000) > libicui18n.so.48 => /usr/lib/x86_64-linux-gnu/libicui18n.so.48 > (0x00007f7275ce4000) > libicuuc.so.48 => /usr/lib/x86_64-linux-gnu/libicuuc.so.48 > (0x00007f7275974000) > libicudata.so.48 => /usr/lib/x86_64-linux-gnu/libicudata.so.48 > (0x00007f7274604000) > libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7274382000) > libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 > (0x00007f727416b000) > libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7273de4000) > libtasn1.so.3 => /usr/lib/x86_64-linux-gnu/libtasn1.so.3 > (0x00007f7273bd3000) > libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 > (0x00007f72739c0000) > libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 > (0x00007f72737bd000) > liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f727359a000) > /lib64/ld-linux-x86-64.so.2 (0x00007f7277f9e000) > libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 > (0x00007f7273292000) but the build now fails in autogsdoc with > Making all for tool autogsdoc... > gcc -rdynamic -pthread -shared-libgcc -fexceptions -fgnu-runtime -o > obj/autogsdoc \ > ./obj/autogsdoc.obj/autogsdoc.m.o > ./obj/autogsdoc.obj/AGSParser.m.o ./obj/autogsdoc.obj/AGSOutput.m.o > ./obj/autogsdoc.obj/AGSIndex.m.o ./obj/autogsdoc.obj/AGSHtml.m.o \ > -L../Source/./obj -L/root/GNUstep/Library/Libraries > -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib > -L/usr/local/lib/gnu-gnu-gnu -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu > -lgnustep-base -lobjc -lgnutls -lgcrypt -L/usr/lib -lxml2 -lffi > -lnsl -lrt -ldl -lpthread -lz -licui18n -licuuc -licudata -lm > ../Source/./obj/libgnustep-base.so: undefined reference to > `sel_registerTypedName' > ../Source/./obj/libgnustep-base.so: undefined reference to > `sel_getTypedSelector' > ../Source/./obj/libgnustep-base.so: undefined reference to > `sel_getTypeEncoding' > collect2: error: ld returned 1 exit status Am I doing something wrong or is there a bug somewhere ? Thanks, Philippe -- A l’instar du pou, le coiffeur est un parasite du cheveu. Pierre Desproges _______________________________________________ Discuss-gnustep mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnustep
