Browse Source

create new menu so people can select what format they wish to build uClibc

Mike Frysinger 18 years ago
parent
commit
e1d59aed55

+ 1 - 1
Makefile.in

@@ -246,7 +246,7 @@ ifeq ($(DOPIC),y)
 	fi
 	fi
 endif
 endif
 endif
 endif
-ifeq ($(HAVE_SHARED_FLAT),y)
+ifeq ($(UCLIBC_FORMAT_SHARED_FLAT),y)
 	for file in lib/lib*.gdb; do \
 	for file in lib/lib*.gdb; do \
 		if test -f $$file; then \
 		if test -f $$file; then \
 			$(INSTALL) -m 755 $$file $(PREFIX)$(DEVEL_PREFIX)lib; \
 			$(INSTALL) -m 755 $$file $(PREFIX)$(DEVEL_PREFIX)lib; \

+ 2 - 2
Makerules

@@ -11,7 +11,7 @@ libs: $(lib-so-y) $(lib-a-y)
 $(lib-so-y): $(interp)
 $(lib-so-y): $(interp)
 else
 else
 .LIBPATTERNS: "lib%.a"
 .LIBPATTERNS: "lib%.a"
-ifeq ($(HAVE_SHARED_FLAT),y)
+ifeq ($(UCLIBC_FORMAT_SHARED_FLAT),y)
 libs: $(lib-gdb-y)
 libs: $(lib-gdb-y)
 endif
 endif
 libs: $(lib-a-y)
 libs: $(lib-a-y)
@@ -207,7 +207,7 @@ $(headers_dep):
 
 
 CRT := crt1
 CRT := crt1
 
 
-ifeq ($(HAVE_SHARED)$(HAVE_SHARED_FLAT),y)
+ifeq ($(HAVE_SHARED)$(UCLIBC_FORMAT_SHARED_FLAT),y)
 CRTS=$(top_builddir)lib/$(CRT).o $(top_builddir)lib/S$(CRT).o
 CRTS=$(top_builddir)lib/$(CRT).o $(top_builddir)lib/S$(CRT).o
 else
 else
 CRTS=$(top_builddir)lib/$(CRT).o
 CRTS=$(top_builddir)lib/$(CRT).o

+ 0 - 24
extra/Configs/Config.in

@@ -196,30 +196,6 @@ config DOPIC
 	  If you wish to build all of uClibc as PIC objects, then answer Y here.
 	  If you wish to build all of uClibc as PIC objects, then answer Y here.
 	  If you are unsure, then you should answer N.
 	  If you are unsure, then you should answer N.
 
 
-config HAVE_SHARED_FLAT
-	bool "Generate a flat-format shared library"
-	default n
-	depends on !ARCH_USE_MMU
-	help
-	  Answer Y here if you are using uClinux and wish to build uClibc
-	  as a flat-format shared library.
-
-config SHARED_FLAT_ID
-	int "Shared library id"
-	default 1
-	depends on HAVE_SHARED_FLAT
-	help
-	  When using flat shared libraries, every library has a unique
-	  system-wide identifier.  Identifier 0 is reserved for
-	  executables and true shared libraries have identifiers
-	  starting at 1.  The maximum shared library identifier is
-	  determined by the kernel and is usually 3.  Shared library
-	  N must be available on the target system as "/lib/libN.so".
-
-	  When a shared C library is used, it usually has identifier 1,
-	  but you can use this option to select a different identifier
-	  if you need to.
-
 config HAVE_NO_SHARED
 config HAVE_NO_SHARED
 	bool
 	bool
 	default n
 	default n

+ 47 - 0
extra/Configs/Config.in.arch

@@ -3,6 +3,53 @@
 # see extra/config/Kconfig-language.txt
 # see extra/config/Kconfig-language.txt
 #
 #
 
 
+
+#
+# Binary format
+#
+choice
+	prompt "Target File Format"
+config UCLIBC_FORMAT_ELF
+	bool "ELF"
+	depends on ARCH_USE_MMU
+config UCLIBC_FORMAT_FDPIC_ELF
+	bool "FDPIC ELF"
+	depends on !ARCH_USE_MMU
+config UCLIBC_FORMAT_FLAT
+	bool "STATIC FLAT"
+	depends on !ARCH_USE_MMU
+config UCLIBC_FORMAT_FLAT_SEP_DATA
+	bool "STATIC FLAT (sep-data)"
+	depends on !ARCH_USE_MMU
+config UCLIBC_FORMAT_SHARED_FLAT
+	bool "SHARED FLAT"
+	depends on !ARCH_USE_MMU
+	help
+	  Pick this one if you are using uClinux and wish to build
+	  uClibc as a flat-format shared library.
+endchoice
+
+config UCLIBC_SHARED_FLAT_ID
+	int "Shared library ID"
+	default 1
+	depends on UCLIBC_FORMAT_SHARED_FLAT
+	help
+	  When using flat shared libraries, every library has a unique
+	  system-wide identifier.  Identifier 0 is reserved for
+	  executables and true shared libraries have identifiers
+	  starting at 1.  The maximum shared library identifier is
+	  determined by the kernel and is usually 3.  Shared library
+	  N must be available on the target system as "/lib/libN.so".
+
+	  When a shared C library is used, it usually has identifier 1,
+	  but you can use this option to select a different identifier
+	  if you need to.
+
+
+
+#
+# Endian Format
+#
 config ARCH_ANY_ENDIAN
 config ARCH_ANY_ENDIAN
 	bool
 	bool
 config ARCH_BIG_ENDIAN
 config ARCH_BIG_ENDIAN

+ 1 - 1
libc/misc/internals/Makefile.in

@@ -18,7 +18,7 @@ MISC_INTERNALS_OBJ := $(patsubst %.c,$(MISC_INTERNALS_OUT)/%.o,$(CSRC))
 libc-y += $(MISC_INTERNALS_OBJ)
 libc-y += $(MISC_INTERNALS_OBJ)
 libc-shared-y += $(MISC_INTERNALS_OUT)/__uClibc_main.oS
 libc-shared-y += $(MISC_INTERNALS_OUT)/__uClibc_main.oS
 libc-static-y += $(MISC_INTERNALS_OUT)/__uClibc_main.o
 libc-static-y += $(MISC_INTERNALS_OUT)/__uClibc_main.o
-libc-static-$(HAVE_SHARED_FLAT) += \
+libc-static-$(UCLIBC_FORMAT_SHARED_FLAT) += \
   $(MISC_INTERNALS_OUT)/shared_flat_initfini.o \
   $(MISC_INTERNALS_OUT)/shared_flat_initfini.o \
   $(MISC_INTERNALS_OUT)/shared_flat_add_library.o
   $(MISC_INTERNALS_OUT)/shared_flat_add_library.o
 libc-nomulti-y += $(MISC_INTERNALS_OUT)/__uClibc_main.o
 libc-nomulti-y += $(MISC_INTERNALS_OUT)/__uClibc_main.o

+ 8 - 8
libc/misc/internals/__uClibc_main.c

@@ -88,9 +88,9 @@ extern void weak_function _locale_init(void) attribute_hidden;
 extern void weak_function __pthread_initialize_minimal(void);
 extern void weak_function __pthread_initialize_minimal(void);
 #endif
 #endif
 
 
-/* If __HAVE_SHARED_FLAT__, all array initialisation and finalisation
+/* If __UCLIBC_FORMAT_SHARED_FLAT__, all array initialisation and finalisation
  * is handled by the routines passed to __uClibc_main().  */
  * is handled by the routines passed to __uClibc_main().  */
-#if defined (__UCLIBC_CTOR_DTOR__) && !defined (__HAVE_SHARED_FLAT__)
+#if defined (__UCLIBC_CTOR_DTOR__) && !defined (__UCLIBC_FORMAT_SHARED_FLAT__)
 extern void _dl_app_init_array(void);
 extern void _dl_app_init_array(void);
 extern void _dl_app_fini_array(void);
 extern void _dl_app_fini_array(void);
 # ifndef SHARED
 # ifndef SHARED
@@ -249,11 +249,11 @@ libc_hidden_proto(__uClibc_fini)
 void __uClibc_fini(void)
 void __uClibc_fini(void)
 {
 {
 #ifdef __UCLIBC_CTOR_DTOR__
 #ifdef __UCLIBC_CTOR_DTOR__
-    /* If __HAVE_SHARED_FLAT__, all array finalisation is handled
+    /* If __UCLIBC_FORMAT_SHARED_FLAT__, all array finalisation is handled
      * by __app_fini.  */
      * by __app_fini.  */
 # ifdef SHARED
 # ifdef SHARED
     _dl_app_fini_array();
     _dl_app_fini_array();
-# elif !defined (__HAVE_SHARED_FLAT__)
+# elif !defined (__UCLIBC_FORMAT_SHARED_FLAT__)
     size_t i = __fini_array_end - __fini_array_start;
     size_t i = __fini_array_end - __fini_array_start;
     while (i-- > 0)
     while (i-- > 0)
 	(*__fini_array_start [i]) ();
 	(*__fini_array_start [i]) ();
@@ -352,9 +352,9 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc,
     /* Arrange for the application's dtors to run before we exit.  */
     /* Arrange for the application's dtors to run before we exit.  */
     __app_fini = app_fini;
     __app_fini = app_fini;
 
 
-    /* If __HAVE_SHARED_FLAT__, all array initialisation is handled
+    /* If __UCLIBC_FORMAT_SHARED_FLAT__, all array initialisation is handled
      * by __app_init.  */
      * by __app_init.  */
-# if !defined (SHARED) && !defined (__HAVE_SHARED_FLAT__)
+# if !defined (SHARED) && !defined (__UCLIBC_FORMAT_SHARED_FLAT__)
     /* For dynamically linked executables the preinit array is executed by
     /* For dynamically linked executables the preinit array is executed by
        the dynamic linker (before initializing any shared object).
        the dynamic linker (before initializing any shared object).
        For static executables, preinit happens rights before init.  */
        For static executables, preinit happens rights before init.  */
@@ -369,11 +369,11 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc,
     if (app_init!=NULL) {
     if (app_init!=NULL) {
 	app_init();
 	app_init();
     }
     }
-    /* If __HAVE_SHARED_FLAT__, all array initialisation is handled
+    /* If __UCLIBC_FORMAT_SHARED_FLAT__, all array initialisation is handled
      * by __app_init.  */
      * by __app_init.  */
 # ifdef SHARED
 # ifdef SHARED
     _dl_app_init_array();
     _dl_app_init_array();
-# elif !defined (__HAVE_SHARED_FLAT__)
+# elif !defined (__UCLIBC_FORMAT_SHARED_FLAT__)
     {
     {
 	const size_t size = __init_array_end - __init_array_start;
 	const size_t size = __init_array_end - __init_array_start;
 	size_t i;
 	size_t i;

+ 2 - 2
libc/sysdeps/linux/m68k/crt1.S

@@ -85,7 +85,7 @@ _start:
 	.equ have_current_got, 1
 	.equ have_current_got, 1
 #endif
 #endif
 	
 	
-#ifdef __HAVE_SHARED_FLAT__
+#ifdef __UCLIBC_FORMAT_SHARED_FLAT__
 	CALL __shared_flat_add_library,%a1
 	CALL __shared_flat_add_library,%a1
 #endif
 #endif
 
 
@@ -113,7 +113,7 @@ _start:
 
 
 	/* Push the address of our own entry points to `.fini' and
 	/* Push the address of our own entry points to `.fini' and
 	   `.init'.  */
 	   `.init'.  */
-#if defined __HAVE_SHARED_FLAT__
+#if defined __UCLIBC_FORMAT_SHARED_FLAT__
 	PEA_TEXT __shared_flat_fini,%a1
 	PEA_TEXT __shared_flat_fini,%a1
 	PEA_TEXT __shared_flat_init,%a1
 	PEA_TEXT __shared_flat_init,%a1
 #else
 #else

+ 3 - 3
libc/sysdeps/linux/m68k/m68k_pic.S

@@ -16,7 +16,7 @@
 	 * a text address.  <tmp> is available as a temporary address
 	 * a text address.  <tmp> is available as a temporary address
 	 * register.  */
 	 * register.  */
 	.macro	DO_TEXT op,target,tmp
 	.macro	DO_TEXT op,target,tmp
-#if defined __HAVE_SHARED_FLAT__
+#if defined __UCLIBC_FORMAT_SHARED_FLAT__
 	.ifne	have_current_got
 	.ifne	have_current_got
 	move.l \target@GOT(%a5),\tmp
 	move.l \target@GOT(%a5),\tmp
 	.else
 	.else
@@ -50,7 +50,7 @@
 
 
 	/* Initialize the global pointer, if functions need to do that.  */
 	/* Initialize the global pointer, if functions need to do that.  */
 	.macro INIT_GP
 	.macro INIT_GP
-#if defined __HAVE_SHARED_FLAT__
+#if defined __UCLIBC_FORMAT_SHARED_FLAT__
 	move.l	%a5,-(%sp)
 	move.l	%a5,-(%sp)
 	move.l _current_shared_library_a5_offset_(%a5),%a5
 	move.l _current_shared_library_a5_offset_(%a5),%a5
 #endif
 #endif
@@ -58,7 +58,7 @@
 
 
 	/* Undo the effects of INIT_GP.  */
 	/* Undo the effects of INIT_GP.  */
 	.macro FINI_GP
 	.macro FINI_GP
-#if defined __HAVE_SHARED_FLAT__
+#if defined __UCLIBC_FORMAT_SHARED_FLAT__
 	move.l	(%sp)+,%a5
 	move.l	(%sp)+,%a5
 #endif
 #endif
 	.endm
 	.endm