eglibc-2.16: Add kconfig infrastructure

This will let eglibc use kernel like option
management through kconfig

(From OE-Core rev: 4282b86072fd5a916d0d12082d6ba575bce691f2)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Khem Raj 2012-09-05 21:52:34 -07:00 committed by Richard Purdie
parent 4bca66470e
commit 607a3d57c5
4 changed files with 1356 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,169 @@
pulled from
http://www.eglibc.org/archives/patches/msg01043.html
Upstream-Status: Pending
Signed-off-by: Khem
This patch builds on the menuconfig patch for EGLIBC.
There are a few options that have non-boolean types, that would benefit from the new 'make *config' support:
EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE (int)
EGLIBC_NSSWITCH_FIXED_CONFIG (string)
EGLIBC_NSSWITCH_FIXED_FUNCTIONS (string)
The patch converts these to real options in libc/option-groups.def. Also, libc/scripts/option-groups.awk is modified to output a '#define' line for int, hex, or string options encountered in the config file.
In the post-processing script config-postproc.pl, a small change is needed: for any boolean option FOO that is implicitly disabled in the kconfig output, make sure that option is indeed a boolean before printing the explicit OPTION_FOO=n.
Finally, libc/malloc/Makefile passes __OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE as a CPPFLAGS, which is not necessary anymore because this macro will now be present in the generated header.
attached is the updated patch to address above issues.
Steve
--
Steve Longerbeam | Senior Embedded Engineer, ESD Services
Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538
P 510.354.5838 | M 408.410.2735
Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS
Index: libc/malloc/Makefile
===================================================================
--- libc.orig/malloc/Makefile 2012-01-04 22:06:18.000000000 -0800
+++ libc/malloc/Makefile 2012-05-09 19:35:28.598682105 -0700
@@ -48,10 +48,6 @@
ifeq ($(OPTION_EGLIBC_MEMUSAGE),y)
extra-libs = libmemusage
extra-libs-others = $(extra-libs)
-
-ifdef OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE
-CPPFLAGS-memusage += -D__OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE=$(OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE)
-endif
endif
libmemusage-routines = memusage
Index: libc/option-groups.def
===================================================================
--- libc.orig/option-groups.def 2012-05-09 19:33:48.398677256 -0700
+++ libc/option-groups.def 2012-05-09 19:35:28.610682107 -0700
@@ -513,8 +513,11 @@
the `memusage' and `memusagestat' utilities.
These components provide memory profiling functions.
- EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE
-
+config EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE
+ int "Memory profiling library buffer size"
+ depends on EGLIBC_MEMUSAGE
+ default "32768"
+ help
Libmemusage library buffers the profiling data in memory
before writing it out to disk. By default, the library
allocates 1.5M buffer, which can be substantial for some
@@ -553,8 +556,11 @@
'option-groups.config' file must set the following two
variables:
- EGLIBC_NSSWITCH_FIXED_CONFIG
-
+config EGLIBC_NSSWITCH_FIXED_CONFIG
+ string "Nsswitch fixed config filename"
+ depends on !EGLIBC_NSSWITCH
+ default ""
+ help
Set this to the name of a file whose contents observe the
same syntax as an ordinary '/etc/nsswitch.conf' file. The
EGLIBC build process parses this file just as EGLIBC would
@@ -576,8 +582,11 @@
you will probably want to delete references to databases not
needed on your system.
- EGLIBC_NSSWITCH_FIXED_FUNCTIONS
-
+config EGLIBC_NSSWITCH_FIXED_FUNCTIONS
+ string "Nsswitch fixed functions filename"
+ depends on !EGLIBC_NSSWITCH
+ default ""
+ help
The EGLIBC build process uses this file to decide which
functions to make available from which service libraries.
The file 'nss/fixed-nsswitch.functions' serves as a sample
Index: libc/options-config/config-postproc.pl
===================================================================
--- libc.orig/options-config/config-postproc.pl 2012-05-09 19:33:36.530676681 -0700
+++ libc/options-config/config-postproc.pl 2012-05-09 19:35:28.610682107 -0700
@@ -8,7 +8,7 @@
die "Could not open $ARGV[0]" unless -T $ARGV[0];
sub yank {
- @option = grep($_ ne $_[0], @option);
+ @option = grep(!($_ =~ /$_[0]\s*=/), @option);
}
open(DEFAULTS, $defaults) || die "Could not open $defaults\n";
@@ -16,7 +16,7 @@
# get the full list of available options using the default config file
$i = 0;
while (<DEFAULTS>) {
- if (/^\s*OPTION_(\w+)\s*=/) {
+ if (/^\s*OPTION_(\w+\s*=.*$)/) {
$option[$i++] = $1;
}
}
@@ -35,8 +35,9 @@
s/CONFIG_/OPTION_/g;
print;
} elsif (/^\s*#\s+CONFIG_(\w+) is not set/) {
- # this is a comment line, change CONFIG_ to OPTION_, remove this
- # option from option list, and convert to explicit OPTION_FOO=n
+ # this is a comment line for an unset boolean option, change CONFIG_
+ # to OPTION_, remove this option from option list, and convert to
+ # explicit OPTION_FOO=n
$opt = $1;
yank($opt);
s/CONFIG_/OPTION_/g;
@@ -46,9 +47,12 @@
}
}
-# any options left in @options, are options that were not mentioned in
+# any boolean options left in @options, are options that were not mentioned in
# the config file, and implicitly that means the option must be set =n,
# so do that here.
foreach $opt (@option) {
- print "OPTION_$opt=n\n";
+ if ($opt =~ /=\s*[yn]/) {
+ $opt =~ s/=\s*[yn]/=n/;
+ print "OPTION_$opt\n";
+ }
}
Index: libc/scripts/option-groups.awk
===================================================================
--- libc.orig/scripts/option-groups.awk 2012-01-04 22:06:00.000000000 -0800
+++ libc/scripts/option-groups.awk 2012-05-09 19:35:28.610682107 -0700
@@ -46,9 +46,15 @@
print "#define __" var " 1"
else if (vars[var] == "n")
print "/* #undef __" var " */"
- # Ignore variables that don't have boolean values.
- # Ideally, this would be driven by the types given in
- # option-groups.def.
+ else if (vars[var] ~ /^[0-9]+/ ||
+ vars[var] ~ /^0x[0-9aAbBcCdDeEfF]+/ ||
+ vars[var] ~ /^\"/)
+ print "#define __" var " " vars[var]
+ else
+ print "/* #undef __" var " */"
+ # Ignore variables that don't have boolean, int, hex, or
+ # string values. Ideally, this would be driven by the types
+ # given in option-groups.def.
}
}

View File

@ -0,0 +1,176 @@
Pulled from
http://www.eglibc.org/archives/patches/msg01035.html
Upstream-Status: Pending
Signed-off-by: Khem
As part of the menuconfig development, I encountered some outdated information in the cross-build instructions, libc/EGLIBC.cross-building. This patch updates the file with new (and tested) instructions. It is unrelated to the menuconfig support, but applies after.
My testing was done with an ARM target, and an x86_64 Linux host, so I converted the instructions to use those host/target types from the original i686/powerpc. Hope that's ok.
Thanks,
--
Steve Longerbeam | Senior Embedded Engineer, ESD Services
Mentor Embedded(tm) | 46871 Bayside Parkway, Fremont, CA 94538
P 510.354.5838 | M 408.410.2735
Nucleus(r) | Linux(r) | Android(tm) | Services | UI | Multi-OS
EGLIBC.cross-building | 59 +++++++++++++++++++++++++++++---------------------
1 file changed, 35 insertions(+), 24 deletions(-)
Index: libc/EGLIBC.cross-building
===================================================================
--- libc.orig/EGLIBC.cross-building 2012-05-09 19:33:36.522676681 -0700
+++ libc/EGLIBC.cross-building 2012-05-09 19:36:13.918684298 -0700
@@ -47,31 +47,34 @@
EGLIBC requires recent versions of the GNU binutils, GCC, and the
Linux kernel. The web page <http://www.eglibc.org/prerequisites>
documents the current requirements, and lists patches needed for
-certain target architectures. As of this writing, EGLIBC required
-binutils 2.17, GCC 4.1, and Linux 2.6.19.1.
+certain target architectures. As of this writing, these build
+instructions have been tested with binutils 2.22.51, GCC 4.6.2,
+and Linux 3.1.
First, let's set some variables, to simplify later commands. We'll
-build EGLIBC and GCC for a PowerPC target, known to the Linux kernel
-as 'powerpc', and we'll do the build on an Intel Linux box:
+build EGLIBC and GCC for an ARM target, known to the Linux kernel
+as 'arm', and we'll do the build on an Intel x86_64 Linux box:
- $ build=i686-pc-linux-gnu
+ $ build=x86_64-pc-linux-gnu
$ host=$build
- $ target=powerpc-none-linux-gnu
- $ linux_arch=powerpc
+ $ target=arm-none-linux-gnueabi
+ $ linux_arch=arm
We're using the aforementioned versions of Binutils, GCC, and Linux:
- $ binutilsv=binutils-2.17
- $ gccv=gcc-4.1.1
- $ linuxv=linux-2.6.20
+ $ binutilsv=binutils-2.22.51
+ $ gccv=gcc-4.6.2
+ $ linuxv=linux-3.1
We're carrying out the entire process under '~/cross-build', which
-contains unpacked source trees:
+contains unpacked source trees for binutils, gcc, and linux kernel,
+along with EGLIBC svn trunk (which can be checked-out with
+'svn co http://www.eglibc.org/svn/trunk eglibc'):
- $ top=$HOME/cross-build/ppc
+ $ top=$HOME/cross-build/$target
$ src=$HOME/cross-build/src
$ ls $src
- binutils-2.17 gcc-4.1.1 libc linux-2.6.20
+ binutils-2.22.51 eglibc gcc-4.6.2 linux-3.1
We're going to place our build directories in a subdirectory 'obj',
we'll install the cross-development toolchain in 'tools', and we'll
@@ -99,7 +102,7 @@
The First GCC
-For our work, we need a cross-compiler targeting a PowerPC Linux
+For our work, we need a cross-compiler targeting an ARM Linux
system. However, that configuration includes the shared library
'libgcc_s.so', which is compiled against the EGLIBC headers (which we
haven't installed yet) and linked against 'libc.so' (which we haven't
@@ -125,7 +128,8 @@
> --prefix=$tools \
> --without-headers --with-newlib \
> --disable-shared --disable-threads --disable-libssp \
- > --disable-libgomp --disable-libmudflap \
+ > --disable-libgomp --disable-libmudflap --disable-libquadmath \
+ > --disable-decimal-float --disable-libffi \
> --enable-languages=c
$ PATH=$tools/bin:$PATH make
$ PATH=$tools/bin:$PATH make install
@@ -162,12 +166,13 @@
> CXX=$tools/bin/$target-g++ \
> AR=$tools/bin/$target-ar \
> RANLIB=$tools/bin/$target-ranlib \
- > $src/libc/configure \
+ > $src/eglibc/libc/configure \
> --prefix=/usr \
> --with-headers=$sysroot/usr/include \
> --build=$build \
> --host=$target \
- > --disable-profile --without-gd --without-cvs --enable-add-ons
+ > --disable-profile --without-gd --without-cvs \
+ > --enable-add-ons=nptl,libidn,../ports
The option '--prefix=/usr' may look strange, but you should never
configure EGLIBC with a prefix other than '/usr': in various places,
@@ -181,6 +186,11 @@
The '--with-headers' option tells EGLIBC where the Linux headers have
been installed.
+The '--enable-add-ons=nptl,libidn,../ports' option tells EGLIBC to look
+for the listed glibc add-ons. Most notably the ports add-on (located
+just above the libc sources in the EGLIBC svn tree) is required to
+support ARM targets.
+
We can now use the 'install-headers' makefile target to install the
headers:
@@ -223,6 +233,7 @@
> --prefix=$tools \
> --with-sysroot=$sysroot \
> --disable-libssp --disable-libgomp --disable-libmudflap \
+ > --disable-libffi --disable-libquadmath \
> --enable-languages=c
$ PATH=$tools/bin:$PATH make
$ PATH=$tools/bin:$PATH make install
@@ -240,13 +251,14 @@
> CXX=$tools/bin/$target-g++ \
> AR=$tools/bin/$target-ar \
> RANLIB=$tools/bin/$target-ranlib \
- > $src/libc/configure \
+ > $src/eglibc/libc/configure \
> --prefix=/usr \
> --with-headers=$sysroot/usr/include \
> --with-kconfig=$obj/linux/scripts/kconfig \
> --build=$build \
> --host=$target \
- > --disable-profile --without-gd --without-cvs --enable-add-ons
+ > --disable-profile --without-gd --without-cvs \
+ > --enable-add-ons=nptl,libidn,../ports
Note the additional '--with-kconfig' option. This tells EGLIBC where to
find the host config tools used by the kernel 'make config' and 'make
@@ -337,15 +349,15 @@
ELF Header:
...
Type: EXEC (Executable file)
- Machine: PowerPC
+ Machine: ARM
...
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000034 0x10000034 0x10000034 0x00100 0x00100 R E 0x4
- INTERP 0x000134 0x10000134 0x10000134 0x0000d 0x0000d R 0x1
- [Requesting program interpreter: /lib/ld.so.1]
- LOAD 0x000000 0x10000000 0x10000000 0x008f0 0x008f0 R E 0x10000
+ INTERP 0x000134 0x00008134 0x00008134 0x00013 0x00013 R 0x1
+ [Requesting program interpreter: /lib/ld-linux.so.3]
+ LOAD 0x000000 0x00008000 0x00008000 0x0042c 0x0042c R E 0x8000
...
Looking at the dynamic section of the installed 'libgcc_s.so', we see
@@ -357,7 +369,6 @@
Dynamic section at offset 0x1083c contains 24 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libc.so.6]
- 0x00000001 (NEEDED) Shared library: [ld.so.1]
0x0000000e (SONAME) Library soname: [libgcc_s.so.1]
...

View File

@ -3,7 +3,7 @@ require eglibc.inc
SRCREV = "20393"
DEPENDS += "gperf-native"
PR = "r7"
PR = "r8"
PR_append = "+svnr${SRCPV}"
EGLIBC_BRANCH="eglibc-2_16"
@ -26,6 +26,9 @@ SRC_URI = "svn://www.eglibc.org/svn/branches/;module=${EGLIBC_BRANCH};protocol=h
file://add_resource_h_to_wait_h.patch \
file://0001-Avoid-use-of-libgcc_s-and-libgcc_eh-when-building-gl.patch \
file://0001-Add-ARM-specific-static-stubs.c.patch \
file://0001-eglibc-menuconfig-support.patch \
file://0002-eglibc-menuconfig-hex-string-options.patch \
file://0003-eglibc-menuconfig-build-instructions.patch \
"
LIC_FILES_CHKSUM = "file://LICENSES;md5=98a1128c4b58120182cbea3b1752d8b9 \
file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \