Hi All,

As promised in an email earlier on this list, below I have provided a
description of the deviations required for me to successfully build the
initial tools in chapter 5 which are separated by section number.
Attached are a copy of all patches which have been added or changed to
get to this stage. Once blended with the HLFS book, you should be able
to successfully build a functional set of initial tools.

Currently I am working through chapter 6 and will provide a similar
report once I have completed, although it would appear at first glance
that I have a lot of work ahead of me as I already have half a page of
notes and I have just started the butterfly toolchain.

I am more than happy to answer any questions about my work and this
document which you might have.

Finally, I would also like to thank Rob van Dam for his assistance in
working through and solving these issues.

Kind Regards,
Brian.

Chapter 5 Build Issues
======================

5.4 uClibc-0.9.29uClibc-0.9.29
------------------------------
- Applied a patch located by Rob van Dam called
uClibc-0.9.29-fix-internal_function-definition.patch which allows
gettext to compile correctly.
- Applied a patch I created called
uClibc-0.9.29-fix-error_print_progname.patch which also allows gettext
to compile which enables access to the error_print_progname variable.

5.9 Cocoon Toolchain
--------------------
- We need to execute the cleanup for fixincludes after installation as
we did in the Embryo Toolchain. This will enable the Bash build to
complete correctly.

Command:
GCC_INCLUDEDIR=`dirname $(gcc -print-libgcc-file-name)`/include &&
find ${GCC_INCLUDEDIR}/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \; &&
rm -vf `grep -l "DO NOT EDIT THIS FILE" ${GCC_INCLUDEDIR}/*` &&
unset GCC_INCLUDEDIR

5.25 Perl-5.8.8
---------------
- Corrected the content of the patch being applied to perl as the one
specified was for the build using glibc not uClibc. The difference is
the name of the libc.so file. glibc = libc.so.6, uClibc = libc.so.0. The
name of the new patch file is perl-5.8.8-uClibc-2.patch.

5.26 Sed-4.1.5
--------------
- Applied a patch located by Rob van Dam called sed-4.1.4-uClibc-1.patch
which corrects the build proceedure for sed when linked against uClibc.
This patch fixes the "Memory Exhausted" error.

5.32 Stripping
--------------
- It should be documented that the stripping must be run as root. I
noticed that there were some permission errors when stripping as the
hlfs user.

Submitted By: Anderson Lizardo <andersonlizardo(at)yahoo(dot)com(dot)br>
Date: 2006-02-15
Initial Package Version: 5.8.8
Origin: based on current LFS-BOOK patch (perl-5.8.0-libc-2.patch)
Description: this patch adapts some hard-wired paths to the C library.
             It uses the $prefix variable to locate the correct libc.

diff -Naur perl-5.8.8.orig/hints/linux.sh perl-5.8.8/hints/linux.sh
--- perl-5.8.8.orig/hints/linux.sh      2005-11-18 01:18:45.000000000 +0000
+++ perl-5.8.8/hints/linux.sh   2006-02-12 12:20:32.000000000 +0000
@@ -52,9 +52,9 @@
 # We don't use __GLIBC__ and  __GLIBC_MINOR__ because they
 # are insufficiently precise to distinguish things like
 # libc-2.0.6 and libc-2.0.7.
-if test -L /lib/libc.so.6; then
-    libc=`ls -l /lib/libc.so.6 | awk '{print $NF}'`
-    libc=/lib/$libc
+if test -L ${prefix}/lib/libc.so.0; then
+    libc=`ls -l ${prefix}/lib/libc.so.0 | awk '{print $NF}'`
+    libc=${prefix}/lib/$libc
 fi
 
 # Configure may fail to find lstat() since it's a static/inline
@@ -330,3 +330,8 @@
     libswanted="$*"
     ;;
 esac
+
+locincpth=""
+loclibpth=""
+glibpth="${prefix}/lib"
+usrinc="${prefix}/include"
Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
Date: 2005-10-02
Initial Package Version: 4.1.4
Upstream Status: Accepted Upstream
Origin: 
http://lists.gnu.org/archive/html/bug-gnu-utils/2005-08/txtVau5I71LDV.txt
Description: This corrects a problem with a "Memory exhausted" error when Sed
is linked to uClibc 0.9.28.

diff -Naur sed-4.1.4.orig/lib/regex_internal.c sed-4.1.4/lib/regex_internal.c
--- sed-4.1.4.orig/lib/regex_internal.c 2005-01-28 09:07:56 +0000
+++ sed-4.1.4/lib/regex_internal.c      2005-08-24 03:20:28 +0000
@@ -885,8 +885,9 @@
 {
   set->alloc = size;
   set->nelem = 0;
-  set->elems = re_malloc (int, size);
-  if (BE (set->elems == NULL, 0))
+  set->elems = re_malloc (int, size); /* can be NULL if size == 0
+                               (see re_node_set_init_empty(set)) */
+  if (BE (set->elems == NULL && size != 0, 0))
     return REG_ESPACE;
   return REG_NOERROR;
 }
Submitted By: Brian Cheeseman <briancheeseman at aapt dot net dot au> (BCheese)
Date: 2007-07-20
Initial Package Version: 0.9.29
Description: This enables the variable error_print_progname within uClibc 0.9.28
which is required by some packages.
--- uClibc-0.9.29/libc/misc/error/error.c.orig  2007-07-19 20:44:03 +0000
+++ uClibc-0.9.29/libc/misc/error/error.c       2007-07-19 20:44:16 +0000
@@ -47,7 +47,7 @@
 /* If NULL, error will flush stdout, then print on stderr the program
    name, a colon and a space.  Otherwise, error will call this
    function without parameters instead.  */
-/* void (*error_print_progname) (void) = NULL; */
+void (*error_print_progname) (void) = NULL;
 
 extern __typeof(error) __error attribute_hidden;
 void __error (int status, int errnum, const char *message, ...)
Index: uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
===================================================================
--- uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h  (revision 18898)
+++ uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h  (working copy)
@@ -42,6 +42,8 @@
 /* define if target supports IEEE signed zero floats */
 #define __UCLIBC_HAVE_SIGNED_ZERO__
 
+#if defined _LIBC
 #define internal_function __attribute__ ((regparm (3), stdcall))
+#endif
 
 #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
Index: uClibc/include/libc-symbols.h
===================================================================
--- uClibc/include/libc-symbols.h       (revision 18898)
+++ uClibc/include/libc-symbols.h       (working copy)
@@ -22,6 +22,16 @@
 #ifndef _LIBC_SYMBOLS_H
 #define _LIBC_SYMBOLS_H        1
 
+/* This is defined for the compilation of all C library code.  features.h
+   tests this to avoid inclusion of stubs.h while compiling the library,
+   before stubs.h has been generated.  Some library code that is shared
+   with other packages also tests this symbol to see if it is being
+   compiled as part of the C library.  We must define this before including
+   config.h, because it makes some definitions conditional on whether libc
+   itself is being compiled, or just some generator program.  */
+#define _LIBC  1
+
+
 /* This file's macros are included implicitly in the compilation of every
    file in the C library by -imacros.
 
@@ -40,16 +50,6 @@
 
 #include <bits/uClibc_arch_features.h>
 
-
-/* This is defined for the compilation of all C library code.  features.h
-   tests this to avoid inclusion of stubs.h while compiling the library,
-   before stubs.h has been generated.  Some library code that is shared
-   with other packages also tests this symbol to see if it is being
-   compiled as part of the C library.  We must define this before including
-   config.h, because it makes some definitions conditional on whether libc
-   itself is being compiled, or just some generator program.  */
-#define _LIBC  1
-
 /* Enable declarations of GNU extensions, since we are compiling them.  */
 #define _GNU_SOURCE    1
 
-- 
http://linuxfromscratch.org/mailman/listinfo/hlfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to