linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] ia64 fixes
@ 2003-11-24  3:59 Arnd Bergmann
  2003-11-24 17:09 ` Martin Hicks
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Arnd Bergmann @ 2003-11-24  3:59 UTC (permalink / raw)
  To: linux-hotplug

On Monday 24 November 2003 18:09, Martin Hicks wrote:

> My makefile-foo is probably sub-par.  If 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.  If 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)?  The
> 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 @@
>         CFLAGS+=-pipe
>  endif
>  
> +ifeq ($(strip $(ARCH)),ia64)
> +       BITSd
> +endif
> +

The information can be taken from klibc/arch/${ARCH}/MCONFIG.

> -       $(CC) $(LDFLAGS) -o $(ROOT) $(CRT0) $(OBJS) $(LIB_OBJS) $(ARCH_LIB_OBJS)
> +       $(LD) $(LDFLAGS) -o $(ROOT) $(CRT0) $(OBJS) $(LIB_OBJS) $(ARCH_LIB_OBJS)

Using ld instead of gcc breaks 32 bit platforms, unless you manually add libgcc
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-compiling.

	Arnd <><

=== Makefile 1.37 vs edited ==--- 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 = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
 CC = $(CROSS)gcc
+LD = $(CROSS)gcc
 AR = $(CROSS)ar
 STRIP = $(CROSS)strip
 RANLIB = $(CROSS)ranlib
@@ -109,6 +110,7 @@
 ifeq ($(strip $(KLIBC)),true)
 	KLIBC_DIR	= klibc/klibc
 	INCLUDE_DIR	:= $(KLIBC_DIR)/include
+	include $(KLIBC_DIR)/arch/$(ARCH)/MCONFIG
 	# arch specific objects
 	LIBGCC		= $(shell $(CC) --print-libgcc)
 	ARCH_LIB_OBJS =	\
@@ -117,8 +119,10 @@
 
 
 	CRT0 = $(KLIBC_DIR)/crt0.o
-	LIBC =	$(ARCH_LIB_OBJS) $(LIB_OBJS)
-	CFLAGS += -nostdinc -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/bits32 -I$(GCCINCDIR) -Iklibc/linux/include -D__KLIBC__
+	LIBC =	$(ARCH_LIB_OBJS) $(LIB_OBJS) $(CRT0)
+	CFLAGS += -nostdinc -I$(INCLUDE_DIR) -I$(KLIBC_DIR)/arch/$(ARCH)/include \
+		-I$(INCLUDE_DIR)/bits$(BITSIZE) -I$(GCCINCDIR) -Iklibc/linux/include \
+		-D__KLIBC__
 	LIB_OBJS  	LDFLAGS = --static --nostdlib -nostartfiles
 else
@@ -169,7 +173,7 @@
 
 
 $(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)
 
 clean:
=== tdb/tdb.h 1.1 vs edited ==--- 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
 
+#include <signal.h>
 
 /* 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] ia64 fixes
  2003-11-24  3:59 [PATCH] ia64 fixes Arnd Bergmann
@ 2003-11-24 17:09 ` Martin Hicks
  2003-11-24 18:08 ` Martin Hicks
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Martin Hicks @ 2003-11-24 17:09 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 3306 bytes --]


Hi Greg,

I currently need the attached patch to get udev to even compile againt
klibc.  I think there are still problems with the CALLOUT pipe failing. 
It's likely klibc's fault.  I'll investigate that this afternoon.

My makefile-foo is probably sub-par.  If someone could figure out a good
way to get things right for 64bit platforms, then that would be good.

I'm not entirely sure why I had to change $(GCC) to $(LD) in the link
step.  If 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)?  The
old Makefile.klibc used $(LD), which allowed me to track down this
problem.

thanks,
mh

-- 
Martin Hicks || mort@bork.org || PGP/GnuPG: 0x4C7F2BEE

# This is a BitKeeper generated patch for the following project:
# Project Name: udev
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.199   -> 1.200  
#	            Makefile	1.34    -> 1.35   
#	           tdb/tdb.h	1.1     -> 1.2    
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/11/24	mort@green.i.bork.org	1.200
# -Fixes for 64 bit platform.
# -I also had to change the makefile to use the linker on the final step to avoid
#  an error on ia64.
# -Included signal.h in tdb/tdb.h to fix a compile problem for ia64.
# --------------------------------------------
#
diff -Nru a/Makefile b/Makefile
--- a/Makefile	Mon Nov 24 12:03:31 2003
+++ b/Makefile	Mon Nov 24 12:03:31 2003
@@ -65,6 +65,9 @@
 ARCH := ${shell $(CC) -dumpmachine | sed -e s'/-.*//' -e 's/i.86/i386/' -e 's/sparc.*/sparc/' \
 	-e 's/arm.*/arm/g' -e 's/m68k.*/m68k/' -e 's/ppc/powerpc/g'}
 
+# Defaults to 32-bit.
+BITS := 32
+
 # code taken from uClibc to determine the gcc include dir
 GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
 
@@ -93,6 +96,10 @@
 	CFLAGS+=-pipe
 endif
 
+ifeq ($(strip $(ARCH)),ia64)
+	BITS=64
+endif
+
 # if DEBUG is enabled, then we do not strip or optimize
 ifeq ($(strip $(DEBUG)),true)
 	CFLAGS  += $(WARNINGS) -O1 -g -DDEBUG -D_GNU_SOURCE
@@ -117,8 +124,10 @@
 
 
 	CRT0 = $(KLIBC_DIR)/crt0.o
-	LIBC =	$(ARCH_LIB_OBJS) $(LIB_OBJS)
-	CFLAGS += -nostdinc -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/bits32 -I$(GCCINCDIR) -Iklibc/linux/include -D__KLIBC__
+	LIBC =	$(ARCH_LIB_OBJS) $(LIB_OBJS) $(CRT0)
+	CFLAGS += -nostdinc -I$(INCLUDE_DIR) -I$(KLIBC_DIR)/arch/$(ARCH)/include \
+		-I$(INCLUDE_DIR)/bits$(BITS) -I$(GCCINCDIR) -Iklibc/linux/include \
+		-D__KLIBC__
 	LIB_OBJS =
 	LDFLAGS = --static --nostdlib -nostartfiles
 else
@@ -166,7 +175,7 @@
 
 
 $(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)
 
 clean:
diff -Nru a/tdb/tdb.h b/tdb/tdb.h
--- a/tdb/tdb.h	Mon Nov 24 12:03:31 2003
+++ b/tdb/tdb.h	Mon Nov 24 12:03:31 2003
@@ -25,6 +25,7 @@
 extern "C" {
 #endif
 
+#include <signal.h>
 
 /* flags to tdb_store() */
 #define TDB_REPLACE 1


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ia64 fixes
  2003-11-24  3:59 [PATCH] ia64 fixes Arnd Bergmann
  2003-11-24 17:09 ` Martin Hicks
@ 2003-11-24 18:08 ` Martin Hicks
  2003-11-24 21:00 ` Martin Hicks
  2003-11-24 22:15 ` Greg KH
  3 siblings, 0 replies; 5+ messages in thread
From: Martin Hicks @ 2003-11-24 18:08 UTC (permalink / raw)
  To: linux-hotplug

On Mon, 2003-11-24 at 12:09, Martin Hicks wrote:
> Hi Greg,
> 

Grr...
I'm not having a good patch day. Here's one that isn't mangled by pgp.

mh

-- 
Martin Hicks || mort@bork.org || PGP/GnuPG: 0x4C7F2BEE

# This is a BitKeeper generated patch for the following project:
# Project Name: udev
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.199   -> 1.200  
#	            Makefile	1.34    -> 1.35   
#	           tdb/tdb.h	1.1     -> 1.2    
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/11/24	mort@green.i.bork.org	1.200
# -Fixes for 64 bit platform.
# -I also had to change the makefile to use the linker on the final step to avoid
#  an error on ia64.
# -Included signal.h in tdb/tdb.h to fix a compile problem for ia64.
# --------------------------------------------
#
diff -Nru a/Makefile b/Makefile
--- a/Makefile	Mon Nov 24 12:03:31 2003
+++ b/Makefile	Mon Nov 24 12:03:31 2003
@@ -65,6 +65,9 @@
 ARCH := ${shell $(CC) -dumpmachine | sed -e s'/-.*//' -e 's/i.86/i386/' -e 's/sparc.*/sparc/' \
 	-e 's/arm.*/arm/g' -e 's/m68k.*/m68k/' -e 's/ppc/powerpc/g'}
 
+# Defaults to 32-bit.
+BITS := 32
+
 # code taken from uClibc to determine the gcc include dir
 GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
 
@@ -93,6 +96,10 @@
 	CFLAGS+=-pipe
 endif
 
+ifeq ($(strip $(ARCH)),ia64)
+	BITSd
+endif
+
 # if DEBUG is enabled, then we do not strip or optimize
 ifeq ($(strip $(DEBUG)),true)
 	CFLAGS  += $(WARNINGS) -O1 -g -DDEBUG -D_GNU_SOURCE
@@ -117,8 +124,10 @@
 
 
 	CRT0 = $(KLIBC_DIR)/crt0.o
-	LIBC =	$(ARCH_LIB_OBJS) $(LIB_OBJS)
-	CFLAGS += -nostdinc -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/bits32 -I$(GCCINCDIR) -Iklibc/linux/include -D__KLIBC__
+	LIBC =	$(ARCH_LIB_OBJS) $(LIB_OBJS) $(CRT0)
+	CFLAGS += -nostdinc -I$(INCLUDE_DIR) -I$(KLIBC_DIR)/arch/$(ARCH)/include \
+		-I$(INCLUDE_DIR)/bits$(BITS) -I$(GCCINCDIR) -Iklibc/linux/include \
+		-D__KLIBC__
 	LIB_OBJS  	LDFLAGS = --static --nostdlib -nostartfiles
 else
@@ -166,7 +175,7 @@
 
 
 $(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)
 
 clean:
diff -Nru a/tdb/tdb.h b/tdb/tdb.h
--- a/tdb/tdb.h	Mon Nov 24 12:03:31 2003
+++ b/tdb/tdb.h	Mon Nov 24 12:03:31 2003
@@ -25,6 +25,7 @@
 extern "C" {
 #endif
 
+#include <signal.h>
 
 /* flags to tdb_store() */
 #define TDB_REPLACE 1




-------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ia64 fixes
  2003-11-24  3:59 [PATCH] ia64 fixes Arnd Bergmann
  2003-11-24 17:09 ` Martin Hicks
  2003-11-24 18:08 ` Martin Hicks
@ 2003-11-24 21:00 ` Martin Hicks
  2003-11-24 22:15 ` Greg KH
  3 siblings, 0 replies; 5+ messages in thread
From: Martin Hicks @ 2003-11-24 21:00 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1667 bytes --]

On Sun, 2003-11-23 at 22:59, Arnd Bergmann wrote:
> On Monday 24 November 2003 18:09, Martin Hicks wrote:
> 
> > I'm not entirely sure why I had to change $(GCC) to $(LD) in the link
> > step.  If 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)?  The
> > 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?

Nothing interesting to me, although I'm not sure what I'm looking for.

> 
> > @@ -93,6 +96,10 @@
> >         CFLAGS+=-pipe
> >  endif
> >  
> > +ifeq ($(strip $(ARCH)),ia64)
> > +       BITS=64
> > +endif
> > +
> 
> The information can be taken from klibc/arch/${ARCH}/MCONFIG.
> 
> > -       $(CC) $(LDFLAGS) -o $(ROOT) $(CRT0) $(OBJS) $(LIB_OBJS) $(ARCH_LIB_OBJS)
> > +       $(LD) $(LDFLAGS) -o $(ROOT) $(CRT0) $(OBJS) $(LIB_OBJS) $(ARCH_LIB_OBJS)

This is a good idea.  I forgot about that file.

> 
> Using ld instead of gcc breaks 32 bit platforms, unless you manually add libgcc
> 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-compiling.

Maybe I'll ask on the ia64 list about the errno thing.
mh

-- 
Martin Hicks || mort@bork.org || PGP/GnuPG: 0x4C7F2BEE

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ia64 fixes
  2003-11-24  3:59 [PATCH] ia64 fixes Arnd Bergmann
                   ` (2 preceding siblings ...)
  2003-11-24 21:00 ` Martin Hicks
@ 2003-11-24 22:15 ` Greg KH
  3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2003-11-24 22:15 UTC (permalink / raw)
  To: linux-hotplug

On Mon, Nov 24, 2003 at 04:59:56AM +0100, Arnd Bergmann wrote:
> On Monday 24 November 2003 18:09, Martin Hicks wrote:
> 
> > My makefile-foo is probably sub-par.  If 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.

Looks good, I've applied this and updated the version of klibc in the
udev release to the latest klibc release (which required this patch).

thanks,

greg k-h


-------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-11-24 22:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-24  3:59 [PATCH] ia64 fixes Arnd Bergmann
2003-11-24 17:09 ` Martin Hicks
2003-11-24 18:08 ` Martin Hicks
2003-11-24 21:00 ` Martin Hicks
2003-11-24 22:15 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).