From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Date: Mon, 24 Nov 2003 03:59:56 +0000 Subject: Re: [PATCH] ia64 fixes Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Monday 24 November 2003 18:09, Martin Hicks wrote: > My makefile-foo is probably sub-par. =A0If someone could figure out a good > way to get things right for 64bit platforms, then that would be good. This patch works for s390x and should be architecture-independent. Unfortunately, I have found that both the s390 and x86-64 kernel headers have trivial bugs that prevent building klibc against them. > I'm not entirely sure why I had to change $(GCC) to $(LD) in the link > step. =A0If I don't I get a warning: > > /usr/bin/ld: Warning: type of symbol 'errno' changed from 1 to 6 in > /usr/lib/gcc-lib/ia64-linux/3.3.2/../../../libc.a(errno.o) > > Maybe we're missing a flag on the final link, while using $(GCC)? =A0The > old Makefile.klibc used $(LD), which allowed me to track down this > problem. Hmm, it does sound like a real problem. If you are using a glibc with tls enabled, simply using 'extern int errno;' is guaranteed to fail. Does 'find -name \*.o | xargs readelf -a | grep errno' reveal anything interesting? > @@ -93,6 +96,10 @@ > =A0=A0=A0=A0=A0=A0=A0=A0CFLAGS+=3D-pipe > =A0endif > =A0 > +ifeq ($(strip $(ARCH)),ia64) > +=A0=A0=A0=A0=A0=A0=A0BITSd > +endif > + The information can be taken from klibc/arch/${ARCH}/MCONFIG. > - $(CC) $(LDFLAGS) -o $(ROOT) $(CRT0) $(OBJS) $(LIB_OBJS) $(ARCH_LI= B_OBJS) > + $(LD) $(LDFLAGS) -o $(ROOT) $(CRT0) $(OBJS) $(LIB_OBJS) $(ARCH_LI= B_OBJS) Using ld instead of gcc breaks 32 bit platforms, unless you manually add li= bgcc like we do for the klibc build (64 bit division is a library function). I've also added a definition for LD, so it becomes usable for cross-compili= ng. Arnd <>< =3D=3D=3D Makefile 1.37 vs edited =3D=3D--- 1.37/Makefile Mon Nov 24 06:38:= 00 2003 +++ edited/Makefile Mon Nov 24 04:38:01 2003 @@ -55,6 +55,7 @@ # to compile vs uClibc, that can be done here as well. CROSS =3D #/usr/i386-linux-uclibc/usr/bin/i386-uclibc- CC =3D $(CROSS)gcc +LD =3D $(CROSS)gcc AR =3D $(CROSS)ar STRIP =3D $(CROSS)strip RANLIB =3D $(CROSS)ranlib @@ -109,6 +110,7 @@ ifeq ($(strip $(KLIBC)),true) KLIBC_DIR =3D klibc/klibc INCLUDE_DIR :=3D $(KLIBC_DIR)/include + include $(KLIBC_DIR)/arch/$(ARCH)/MCONFIG # arch specific objects LIBGCC =3D $(shell $(CC) --print-libgcc) ARCH_LIB_OBJS =3D \ @@ -117,8 +119,10 @@ =20 =20 CRT0 =3D $(KLIBC_DIR)/crt0.o - LIBC =3D $(ARCH_LIB_OBJS) $(LIB_OBJS) - CFLAGS +=3D -nostdinc -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/bits32 -I$(GCCINC= DIR) -Iklibc/linux/include -D__KLIBC__ + LIBC =3D $(ARCH_LIB_OBJS) $(LIB_OBJS) $(CRT0) + CFLAGS +=3D -nostdinc -I$(INCLUDE_DIR) -I$(KLIBC_DIR)/arch/$(ARCH)/includ= e \ + -I$(INCLUDE_DIR)/bits$(BITSIZE) -I$(GCCINCDIR) -Iklibc/linux/include \ + -D__KLIBC__ LIB_OBJS LDFLAGS =3D --static --nostdlib -nostartfiles else @@ -169,7 +173,7 @@ =20 =20 $(ROOT): $(GEN_HEADERS) $(OBJS) - $(CC) $(LDFLAGS) -o $(ROOT) $(CRT0) $(OBJS) $(LIB_OBJS) $(ARCH_LIB_OBJS) + $(LD) $(LDFLAGS) -o $(ROOT) $(CRT0) $(OBJS) $(LIB_OBJS) $(ARCH_LIB_OBJS) $(STRIPCMD) $(ROOT) =20 clean: =3D=3D=3D tdb/tdb.h 1.1 vs edited =3D=3D--- 1.1/tdb/tdb.h Tue Aug 5 02:26:= 58 2003 +++ edited/tdb/tdb.h Mon Nov 24 04:29:13 2003 @@ -25,6 +25,7 @@ extern "C" { #endif =20 +#include =20 /* flags to tdb_store() */ #define TDB_REPLACE 1 Arnd <>< ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel