public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 2 of 2] Rework binutils in order to provide soon binutils alternative
  2012-11-19 10:22 [PATCH 1 of 2] Remove sstrip (obsolete) Yann Diorcet
@ 2012-11-19 10:22 ` Yann Diorcet
  2012-11-19 18:58   ` Yann E. MORIN
                     ` (3 more replies)
  2012-11-19 18:23 ` [PATCH 1 of 2] Remove sstrip (obsolete) Yann E. MORIN
  2012-11-19 21:28 ` binutils/sstrip: remove Yann E. MORIN
  2 siblings, 4 replies; 8+ messages in thread
From: Yann Diorcet @ 2012-11-19 10:22 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: crossgcc

# HG changeset patch
# User Yann Diorcet (diorcet.yann@gmail.com)
# Date 1353320491 -3600
# Node ID d3d1d51f399e6d2c1163f2f3ace2e3cbc73b2324
# Parent  65c8bf534d0647ce52cdb319b52dab2f81da5017
Rework binutils in order to provide soon binutils alternative

config: now the binutils is choosen by a menu
script: elf2flt script is merged in binutils.sh

Signed-off-by: Yann Diorcet <diorcet.yann@gmail.com>

diff -r 65c8bf534d06 -r d3d1d51f399e config/binutils.in
--- a/config/binutils.in	Mon Nov 19 11:19:54 2012 +0100
+++ b/config/binutils.in	Mon Nov 19 11:21:31 2012 +0100
@@ -21,11 +21,12 @@
 
 config ARCH_BINFMT_FLAT
     bool
+    depends on ! ARCH_USE_MMU
     prompt "Flat"
     help
       This will build flat binaries, suitable for
       MMU-less architectures.
-
+      
 config ARCH_BINFMT_FDPIC
     bool
     prompt "FD_PIC ELF"
@@ -33,12 +34,14 @@
       This will build FD_PIC ELF binaries, suitable for
       MMU-less architectures that still require to use
       shared libraries (FIXME).
-
 endif # ! ARCH_USE_MMU
 
 endchoice
 
-source "config/binutils/binutils.in"
-source "config/binutils/elf2flt.in"
+config BINUTILS
+    string
+
+source "config.gen/binutils.in"
+source "config.gen/binutils.in.2"
 
 endmenu
diff -r 65c8bf534d06 -r d3d1d51f399e config/binutils/binutils.in
--- a/config/binutils/binutils.in	Mon Nov 19 11:19:54 2012 +0100
+++ b/config/binutils/binutils.in	Mon Nov 19 11:21:31 2012 +0100
@@ -117,6 +117,8 @@
 
 config BINUTILS_GOLD_SUPPORTS_ARCH
     bool
+    default y if ARCH_arm
+    default y if ARCH_x86
 
 config BINUTILS_HAS_PLUGINS
     bool
@@ -124,13 +126,6 @@
 config BINUTILS_HAS_PKGVERSION_BUGURL
     bool
 
-# Only these architectures have support in gold
-config ARCH_arm
-    select BINUTILS_GOLD_SUPPORTS_ARCH
-
-config ARCH_x86
-    select BINUTILS_GOLD_SUPPORTS_ARCH
-
 # Force using the BFD linker if needed
 # This is the case for some C libraries (eg. glibc and
 # eglibc at least) and affected components can select this
diff -r 65c8bf534d06 -r d3d1d51f399e config/binutils/binutils.in.2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/binutils/binutils.in.2	Mon Nov 19 11:21:31 2012 +0100
@@ -0,0 +1,51 @@
+# elf2flt options
+
+if ARCH_BINFMT_FLAT
+
+comment "elf2flt"
+
+choice
+    bool
+    prompt "elf2flt version"
+# Don't remove next line
+# CT_INSERT_VERSION_BELOW
+
+config ELF2FLT_CVSHEAD
+    bool
+    prompt "CVS Head"
+    help
+      Grab the latest version of elf2flt from the CVS repository
+
+config ELF2FLT_CVS_SNAPSHOT
+    bool
+    prompt "CVS Snapshot"
+
+endchoice
+
+config ELF2FLT_CVS_SNAPSHOT_SPEC
+    string
+    depends on ELF2FLT_CVS_SNAPSHOT
+    default ""
+    prompt "CVS refspec for elf2flt"
+    help
+       What you enter here will be passed verbatim to the cvs checkout command
+       so be careful!
+
+config ELF2FLT_VERSION
+    string
+    default "head" if ELF2FLT_CVSHEAD
+# Don't remove next line
+# CT_INSERT_VERSION_STRING_BELOW
+
+config ELF2FLT_EXTRA_CONFIG_ARRAY
+    string
+    prompt "elf2flt extra config"
+    default ""
+    help
+      Extra flags passed onto ./configure when configuring
+      
+      You can enter multiple arguments here, and arguments can contain spaces
+      if they are properly quoted (or escaped, but prefer quotes). Eg.:
+          --with-foo="1st arg with 4 spaces" --with-bar=2nd-arg-without-space
+
+endif
diff -r 65c8bf534d06 -r d3d1d51f399e config/config.mk
--- a/config/config.mk	Mon Nov 19 11:19:54 2012 +0100
+++ b/config/config.mk	Mon Nov 19 11:21:31 2012 +0100
@@ -15,20 +15,23 @@
 $(STATIC_CONFIG_FILES): config
 
 # Build a list of per-component-type source config files
-ARCH_CONFIG_FILES     = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/arch/*.in))
-ARCH_CONFIG_FILES_2   = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/arch/*.in.2))
-KERNEL_CONFIG_FILES   = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/kernel/*.in))
-KERNEL_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/kernel/*.in.2))
-CC_CONFIG_FILES       = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/cc/*.in))
-CC_CONFIG_FILES_2     = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/cc/*.in.2))
-LIBC_CONFIG_FILES     = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/libc/*.in))
-LIBC_CONFIG_FILES_2   = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/libc/*.in.2))
-DEBUG_CONFIG_FILES    = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/debug/*.in))
+ARCH_CONFIG_FILES       = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/arch/*.in))
+ARCH_CONFIG_FILES_2     = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/arch/*.in.2))
+KERNEL_CONFIG_FILES     = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/kernel/*.in))
+KERNEL_CONFIG_FILES_2   = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/kernel/*.in.2))
+CC_CONFIG_FILES         = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/cc/*.in))
+CC_CONFIG_FILES_2       = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/cc/*.in.2))
+BINUTILS_CONFIG_FILES   = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/binutils/*.in))
+BINUTILS_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/binutils/*.in.2))
+LIBC_CONFIG_FILES       = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/libc/*.in))
+LIBC_CONFIG_FILES_2     = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/libc/*.in.2))
+DEBUG_CONFIG_FILES      = $(patsubst $(CT_LIB_DIR)/%,%,$(wildcard $(CT_LIB_DIR)/config/debug/*.in))
 
 # Build the list of generated config files
 GEN_CONFIG_FILES = config.gen/arch.in     \
                    config.gen/kernel.in   \
                    config.gen/cc.in       \
+                   config.gen/binutils.in \
                    config.gen/libc.in     \
                    config.gen/debug.in
 # ... and how to access them:
@@ -58,11 +61,12 @@
 #-----------------------------------------------------------
 # Build list of per-component-type items to easily build generated files
 
-ARCHS   = $(patsubst config/arch/%.in,%,$(ARCH_CONFIG_FILES))
-KERNELS = $(patsubst config/kernel/%.in,%,$(KERNEL_CONFIG_FILES))
-CCS     = $(patsubst config/cc/%.in,%,$(CC_CONFIG_FILES))
-LIBCS   = $(patsubst config/libc/%.in,%,$(LIBC_CONFIG_FILES))
-DEBUGS  = $(patsubst config/debug/%.in,%,$(DEBUG_CONFIG_FILES))
+ARCHS     = $(patsubst config/arch/%.in,%,$(ARCH_CONFIG_FILES))
+KERNELS   = $(patsubst config/kernel/%.in,%,$(KERNEL_CONFIG_FILES))
+CCS       = $(patsubst config/cc/%.in,%,$(CC_CONFIG_FILES))
+BINUTILSS = $(patsubst config/binutils/%.in,%,$(BINUTILS_CONFIG_FILES))
+LIBCS     = $(patsubst config/libc/%.in,%,$(LIBC_CONFIG_FILES))
+DEBUGS    = $(patsubst config/debug/%.in,%,$(DEBUG_CONFIG_FILES))
 
 #-----------------------------------------------------------
 # The rules for the generated config files
@@ -81,6 +85,10 @@
 	@$(ECHO) '  IN    $(@)'
 	$(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "C compiler" "CC" "config/cc" "N" $(CCS)
 
+config.gen/binutils.in: $(CC_BINUTILS_FILES) $(CC_BINUTILS_FILES_2)
+	@$(ECHO) '  IN    $(@)'
+	$(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "Binutils" "BINUTILS" "config/binutils" "N" $(BINUTILSS)
+
 config.gen/libc.in: $(LIBC_CONFIG_FILES) $(LIBC_CONFIG_FILES_2)
 	@$(ECHO) '  IN    $(@)'
 	$(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "C library" "LIBC" "config/libc" "Y" $(LIBCS)
diff -r 65c8bf534d06 -r d3d1d51f399e scripts/build/binutils/binutils.sh
--- a/scripts/build/binutils/binutils.sh	Mon Nov 19 11:19:54 2012 +0100
+++ b/scripts/build/binutils/binutils.sh	Mon Nov 19 11:21:31 2012 +0100
@@ -12,6 +12,14 @@
                    {ftp,http}://{ftp.gnu.org/gnu,ftp.kernel.org/pub/linux/devel}/binutils   \
                    ftp://gcc.gnu.org/pub/binutils/{releases,snapshots}
     fi
+
+    if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
+        CT_GetCVS "elf2flt-cvs-${CT_ELF2FLT_VERSION}"           \
+                  ":pserver:anonymous@cvs.uclinux.org:/var/cvs" \
+                  "elf2flt"                                     \
+                  ""                                            \
+                  "elf2flt-cvs-${CT_ELF2FLT_VERSION}"
+    fi
 }
 
 # Extract binutils
@@ -24,6 +32,11 @@
 
     CT_Extract "binutils-${CT_BINUTILS_VERSION}"
     CT_Patch "binutils" "${CT_BINUTILS_VERSION}"
+
+    if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
+        CT_Extract "elf2flt-cvs-${CT_ELF2FLT_VERSION}"
+        CT_Patch "elf2flt-cvs" "${CT_ELF2FLT_VERSION}"
+    fi
 }
 
 # Build binutils for build -> target
@@ -41,10 +54,21 @@
     binutils_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
     binutils_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
     binutils_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
+    binutils_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-build-${CT_HOST}" )
+    binutils_opts+=( "binutils_src=${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}" )
 
     do_binutils_backend "${binutils_opts[@]}"
 
     CT_Popd
+    
+    if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
+        CT_mkdir_pushd "${CT_BUILD_DIR}/build-elf2flt-build-${CT_BUILD}"
+        
+        do_elf2flt_backend "${binutils_opts[@]}"
+         
+        CT_Popd
+    fi
+    
     CT_EndStep
 }
 
@@ -52,7 +76,7 @@
 do_binutils_for_host() {
     local -a binutils_tools
     local -a binutils_opts
-
+    
     CT_DoStep INFO "Installing binutils for host"
     CT_mkdir_pushd "${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}"
 
@@ -62,9 +86,20 @@
     binutils_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
     binutils_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
     binutils_opts+=( "build_manuals=${CT_BUILD_MANUALS}" )
+    binutils_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}" )
 
     do_binutils_backend "${binutils_opts[@]}"
 
+    CT_Popd
+
+    if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
+        CT_mkdir_pushd "${CT_BUILD_DIR}/build-elf2flt-host-${CT_HOST}"
+
+        do_elf2flt_backend "${binutils_opts[@]}"
+        
+        CT_Popd
+    fi
+    
     # Make those new tools available to the core C compilers to come.
     # Note: some components want the ${TARGET}-{ar,as,ld,strip} commands as
     # well. Create that.
@@ -73,6 +108,9 @@
     case "${CT_TOOLCHAIN_TYPE}" in
         cross|native)
             binutils_tools=( ar as ld strip )
+            if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
+                binutils_tools+=( elf2flt flthdr )
+            fi
             case "${CT_BINUTILS_LINKERS_LIST}" in
                 ld)         binutils_tools+=( ld.bfd ) ;;
                 gold)       binutils_tools+=( ld.gold ) ;;
@@ -93,7 +131,6 @@
         *)  ;;
     esac
 
-    CT_Popd
     CT_EndStep
 }
 
@@ -218,6 +255,50 @@
     fi
 }
 
+# Build elf2flt for X -> target
+#     Parameter     : description               : type      : default
+#     host          : machine to run on         : tuple     : (none)
+#     prefix        : prefix to install into    : dir       : (none)
+#     static_build  : build statcially          : bool      : no
+#     cflags        : cflags to use             : string    : (empty)
+#     ldflags       : ldflags to use            : string    : (empty)
+do_elf2flt_backend() {
+    local host
+    local prefix
+    local static_build
+    local cflags
+    local ldflags
+    local binutils_bld
+    local binutils_src
+    local arg
+
+    for arg in "$@"; do
+        eval "${arg// /\\ }"
+    done
+
+    CT_DoLog EXTRA "Configuring elf2flt"
+    CT_DoExecLog CFG                                            \
+    CFLAGS="${cflags}"                                          \
+    LDFLAGS="${ldflags}"                                        \
+    "${CT_SRC_DIR}/elf2flt-cvs-${CT_ELF2FLT_VERSION}/configure" \
+        --build=${CT_BUILD}                                     \
+        --host=${host}                                          \
+        --target=${CT_TARGET}                                   \
+        --prefix=${prefix}                                      \
+        --with-bfd-include-dir=${binutils_bld}/bfd              \
+        --with-binutils-include-dir=${binutils_src}/include     \
+        --with-libbfd=${binutils_bld}/bfd/libbfd.a              \
+        --with-libiberty=${binutils_bld}/libiberty/libiberty.a  \
+        ${elf2flt_opts}                                         \
+        "${CT_ELF2FLT_EXTRA_CONFIG_ARRAY[@]}"
+
+    CT_DoLog EXTRA "Building elf2flt"
+    CT_DoExecLog ALL make ${JOBSFLAGS}
+
+    CT_DoLog EXTRA "Installing elf2flt"
+    CT_DoExecLog ALL make install
+}
+
 # Now on for the target libraries
 do_binutils_for_target() {
     local -a extra_config
diff -r 65c8bf534d06 -r d3d1d51f399e scripts/crosstool-NG.sh.in
--- a/scripts/crosstool-NG.sh.in	Mon Nov 19 11:19:54 2012 +0100
+++ b/scripts/crosstool-NG.sh.in	Mon Nov 19 11:21:31 2012 +0100
@@ -127,8 +127,7 @@
 . "${CT_LIB_DIR}/scripts/build/companion_tools.sh"
 . "${CT_LIB_DIR}/scripts/build/kernel/${CT_KERNEL}.sh"
 . "${CT_LIB_DIR}/scripts/build/companion_libs.sh"
-. "${CT_LIB_DIR}/scripts/build/binutils/binutils.sh"
-. "${CT_LIB_DIR}/scripts/build/binutils/elf2flt.sh"
+. "${CT_LIB_DIR}/scripts/build/binutils/${CT_BINUTILS}.sh"
 . "${CT_LIB_DIR}/scripts/build/libc/${CT_LIBC}.sh"
 . "${CT_LIB_DIR}/scripts/build/cc/${CT_CC}.sh"
 . "${CT_LIB_DIR}/scripts/build/debug.sh"
@@ -545,7 +544,6 @@
     do_kernel_get
     do_companion_libs_get
     do_binutils_get
-    do_elf2flt_get
     do_cc_get
     do_libc_get
     do_debug_get
@@ -569,7 +567,6 @@
         do_kernel_extract
         do_companion_libs_extract
         do_binutils_extract
-        do_elf2flt_extract
         do_cc_extract
         do_libc_extract
         do_debug_extract
diff -r 65c8bf534d06 -r d3d1d51f399e steps.mk
--- a/steps.mk	Mon Nov 19 11:19:54 2012 +0100
+++ b/steps.mk	Mon Nov 19 11:21:31 2012 +0100
@@ -21,10 +21,8 @@
 CT_STEPS := libc_check_config        \
             companion_libs_for_build \
             binutils_for_build       \
-            elf2flt_for_build        \
             companion_libs_for_host  \
             binutils_for_host        \
-            elf2flt_for_host         \
             cc_core_pass_1           \
             kernel_headers           \
             libc_start_files         \

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* [PATCH 1 of 2] Remove sstrip (obsolete)
@ 2012-11-19 10:22 Yann Diorcet
  2012-11-19 10:22 ` [PATCH 2 of 2] Rework binutils in order to provide soon binutils alternative Yann Diorcet
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Yann Diorcet @ 2012-11-19 10:22 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: crossgcc

# HG changeset patch
# User Yann Diorcet (diorcet.yann@gmail.com)
# Date 1353320394 -3600
# Node ID 65c8bf534d0647ce52cdb319b52dab2f81da5017
# Parent  d24043276c9243a35421763b192f4cf59cea650b
Remove sstrip (obsolete)

config: Remove sstrip in binutils
script: Remove sstrip script

Signed-off-by: Yann Diorcet <diorcet.yann@gmail.com>

diff -r d24043276c92 -r 65c8bf534d06 config/binutils.in
--- a/config/binutils.in	Fri Nov 16 15:25:57 2012 +0100
+++ b/config/binutils.in	Mon Nov 19 11:19:54 2012 +0100
@@ -40,6 +40,5 @@
 
 source "config/binutils/binutils.in"
 source "config/binutils/elf2flt.in"
-source "config/binutils/sstrip.in"
 
 endmenu
diff -r d24043276c92 -r 65c8bf534d06 config/binutils/sstrip.in
--- a/config/binutils/sstrip.in	Fri Nov 16 15:25:57 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-# Configuration file for sstrip tool facility
-
-if OBSOLETE && ! BACKEND && ARCH_BINFMT_ELF
-
-comment "sstrip"
-
-config SSTRIP
-    bool
-    prompt "sstrip (OBSOLETE)"
-    help
-      The sstrip utility, to maximise the striping of ELF binaries
-      (executables and libraries).
-      
-      Buildroot version, forked off the original from ELFkickers.
-      This one is somewhat maintained by the buildroot guys.
-      Supports big-endian systems.
-      
-      NOTE! Please read.
-        sstrip is now deprecated in crosstool-NG, as it has a few
-        shortcomings. For example: it breaks for PPC targets, it
-        does not build on non-ELF hosts (eg. mingw32, MacOS-X...).
-
-endif
diff -r d24043276c92 -r 65c8bf534d06 scripts/build/binutils/sstrip.sh
--- a/scripts/build/binutils/sstrip.sh	Fri Nov 16 15:25:57 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-# This will build and install sstrip to run on host and sstrip target files
-
-do_sstrip_get()      { :; }
-do_sstrip_extract()  { :; }
-do_sstrip_for_host() { :; }
-
-if [ "${CT_SSTRIP}" = "y" ]; then
-    do_sstrip_get() {
-        CT_GetFile sstrip .c http://git.buildroot.net/buildroot/plain/toolchain/sstrip
-    }
-
-    do_sstrip_extract() {
-        # We leave the sstrip maintenance to the buildroot people:
-        # -> any fix-up goes directly there
-        # -> we don't have patches for it
-        # -> we don't need to patch it
-        # -> just create a directory in src/, and copy it there.
-        CT_DoExecLog DEBUG mkdir -p "${CT_SRC_DIR}/sstrip"
-        CT_DoExecLog DEBUG cp -v "${CT_TARBALLS_DIR}/sstrip.c" "${CT_SRC_DIR}/sstrip"
-    }
-
-    # Build sstrip for host -> target
-    # Note: we don't need sstrip to run on the build machine,
-    # so we do not need the frontend/backend stuff...
-    do_sstrip_for_host() {
-        local sstrip_cflags
-        CT_DoStep INFO "Installing sstrip for host"
-        CT_mkdir_pushd "${CT_BUILD_DIR}/build-sstrip-host"
-
-        if [ "${CT_STATIC_TOOLCHAIN}" = "y" ]; then
-            sstrip_cflags="-static"
-        fi
-
-        CT_DoLog EXTRA "Building sstrip"
-        CT_DoExecLog ALL "${CT_HOST}-gcc" -Wall ${sstrip_cflags} -o sstrip "${CT_SRC_DIR}/sstrip/sstrip.c"
-
-        CT_DoLog EXTRA "Installing sstrip"
-        CT_DoExecLog ALL install -m 755 sstrip "${CT_PREFIX_DIR}/bin/${CT_TARGET}-sstrip"
-
-        CT_Popd
-        CT_EndStep
-    }
-fi
diff -r d24043276c92 -r 65c8bf534d06 scripts/crosstool-NG.sh.in
--- a/scripts/crosstool-NG.sh.in	Fri Nov 16 15:25:57 2012 +0100
+++ b/scripts/crosstool-NG.sh.in	Mon Nov 19 11:19:54 2012 +0100
@@ -129,7 +129,6 @@
 . "${CT_LIB_DIR}/scripts/build/companion_libs.sh"
 . "${CT_LIB_DIR}/scripts/build/binutils/binutils.sh"
 . "${CT_LIB_DIR}/scripts/build/binutils/elf2flt.sh"
-. "${CT_LIB_DIR}/scripts/build/binutils/sstrip.sh"
 . "${CT_LIB_DIR}/scripts/build/libc/${CT_LIBC}.sh"
 . "${CT_LIB_DIR}/scripts/build/cc/${CT_CC}.sh"
 . "${CT_LIB_DIR}/scripts/build/debug.sh"
@@ -547,7 +546,6 @@
     do_companion_libs_get
     do_binutils_get
     do_elf2flt_get
-    do_sstrip_get
     do_cc_get
     do_libc_get
     do_debug_get
@@ -572,7 +570,6 @@
         do_companion_libs_extract
         do_binutils_extract
         do_elf2flt_extract
-        do_sstrip_extract
         do_cc_extract
         do_libc_extract
         do_debug_extract
diff -r d24043276c92 -r 65c8bf534d06 steps.mk
--- a/steps.mk	Fri Nov 16 15:25:57 2012 +0100
+++ b/steps.mk	Mon Nov 19 11:19:54 2012 +0100
@@ -25,7 +25,6 @@
             companion_libs_for_host  \
             binutils_for_host        \
             elf2flt_for_host         \
-            sstrip_for_host          \
             cc_core_pass_1           \
             kernel_headers           \
             libc_start_files         \

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* Re: [PATCH 1 of 2] Remove sstrip (obsolete)
  2012-11-19 10:22 [PATCH 1 of 2] Remove sstrip (obsolete) Yann Diorcet
  2012-11-19 10:22 ` [PATCH 2 of 2] Rework binutils in order to provide soon binutils alternative Yann Diorcet
@ 2012-11-19 18:23 ` Yann E. MORIN
  2012-11-19 21:28 ` binutils/sstrip: remove Yann E. MORIN
  2 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2012-11-19 18:23 UTC (permalink / raw)
  To: crossgcc; +Cc: Yann Diorcet

Yann, All,

On Monday 19 November 2012 Yann Diorcet wrote:
> # HG changeset patch
> # User Yann Diorcet (diorcet.yann@gmail.com)

Again, those parenthesis, when you should use < and >.
I fixed it locally. Please be update your ~/.hgrc

> # Date 1353320394 -3600
> # Node ID 65c8bf534d0647ce52cdb319b52dab2f81da5017
> # Parent  d24043276c9243a35421763b192f4cf59cea650b
> Remove sstrip (obsolete)

I've also re-phrased the commit message. Please look at:
    docs/7 - Contributing to crosstool-NG.txt
    docs/C - Misc. tutorials.txt
for how to format the commit messages.

Otherwise, OK. I've applied it locally, will push it later tonight.
Thank you!

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* Re: [PATCH 2 of 2] Rework binutils in order to provide soon binutils alternative
  2012-11-19 10:22 ` [PATCH 2 of 2] Rework binutils in order to provide soon binutils alternative Yann Diorcet
@ 2012-11-19 18:58   ` Yann E. MORIN
  2012-11-19 23:49   ` binutils/binutils: simplify gold dependencies Yann E. MORIN
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2012-11-19 18:58 UTC (permalink / raw)
  To: crossgcc; +Cc: Yann Diorcet

Yann, All,

On Monday 19 November 2012 Yann Diorcet wrote:
> # HG changeset patch
> # User Yann Diorcet (diorcet.yann@gmail.com)
> # Date 1353320491 -3600
> # Node ID d3d1d51f399e6d2c1163f2f3ace2e3cbc73b2324
> # Parent  65c8bf534d0647ce52cdb319b52dab2f81da5017
> Rework binutils in order to provide soon binutils alternative
> 
> config: now the binutils is choosen by a menu
> script: elf2flt script is merged in binutils.sh
> 
> Signed-off-by: Yann Diorcet <diorcet.yann@gmail.com>

Here are my comments on that patch. I think it will be easier to follow
than what I said on IRC (which was quite hard to follow because of the
messages being inter-spersed).

Aside a few space-damage, here are my comments:

> diff -r 65c8bf534d06 -r d3d1d51f399e config/binutils.in
> --- a/config/binutils.in	Mon Nov 19 11:19:54 2012 +0100
> +++ b/config/binutils.in	Mon Nov 19 11:21:31 2012 +0100
> @@ -21,11 +21,12 @@
>  
>  config ARCH_BINFMT_FLAT
>      bool
> +    depends on ! ARCH_USE_MMU

I like this change, but you're already in a "if ! MMU ... endif" block.
So this "depends on" is redundant. I'll fix here.

>      prompt "Flat"
>      help
>        This will build flat binaries, suitable for
>        MMU-less architectures.
> -
> +      

Space-damage.

>  config ARCH_BINFMT_FDPIC
>      bool
>      prompt "FD_PIC ELF"
> @@ -33,12 +34,14 @@
>        This will build FD_PIC ELF binaries, suitable for
>        MMU-less architectures that still require to use
>        shared libraries (FIXME).
> -

Space-damage.

>  endif # ! ARCH_USE_MMU
>  
>  endchoice
[--SNIP--]
> diff -r 65c8bf534d06 -r d3d1d51f399e config/binutils/binutils.in
> --- a/config/binutils/binutils.in	Mon Nov 19 11:19:54 2012 +0100
> +++ b/config/binutils/binutils.in	Mon Nov 19 11:21:31 2012 +0100
> @@ -117,6 +117,8 @@
>  
>  config BINUTILS_GOLD_SUPPORTS_ARCH
>      bool
> +    default y if ARCH_arm
> +    default y if ARCH_x86
>  
>  config BINUTILS_HAS_PLUGINS
>      bool
> @@ -124,13 +126,6 @@
>  config BINUTILS_HAS_PKGVERSION_BUGURL
>      bool
>  
> -# Only these architectures have support in gold
> -config ARCH_arm
> -    select BINUTILS_GOLD_SUPPORTS_ARCH
> -
> -config ARCH_x86
> -    select BINUTILS_GOLD_SUPPORTS_ARCH
> -

Hmmm... When I wrote that code, I had in mind that it was the duty of
architectures to state if they supported binutils/gold or not.

Your change implies that it is binutils/gold that nows if it supports a
specific architecture. I think it makes much more sense this way. But
this should have been a separate patch.

Remember: one semantically autonomous change per patch. Here you're
mixing (at least) two semantic changes, and a cleanup change:
  - cleanup the ELF/FLAT/FDPIC choice dependencies on MMU/BARE_METAL
  - switch the way gold is available
  - introduce the multi-binutils infrastructure

Those three are unrelated, hence should be in different patches. That's
Ok, I'll do the split here. Next time, please try to better split your
changes.

BTW, when I said on IRC that you should submit those changes, I should have
been more explicit: I meant that these changes are an important foundation
of your Darwin port, but are unrelated to it, so you should get rid of
those changes as soon as possible by getting them upstreamed. What I was
not explicit enough about is that those changes should be reworked first.
Hence, I'll do the fixup here.

> diff -r 65c8bf534d06 -r d3d1d51f399e config/binutils/binutils.in.2
> --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
> +++ b/config/binutils/binutils.in.2     Mon Nov 19 11:21:31 2012 +0100

Hmmm... Strange that Mercurial did not catch the file rename. The old
elf2flt.in is still around. Did you use 'hg mv' to do the rename, or
did you do it manually?

I'll fix here.

> diff -r 65c8bf534d06 -r d3d1d51f399e scripts/build/binutils/binutils.sh
> --- a/scripts/build/binutils/binutils.sh	Mon Nov 19 11:19:54 2012 +0100
> +++ b/scripts/build/binutils/binutils.sh	Mon Nov 19 11:21:31 2012 +0100
[--SNIP--]
> @@ -41,10 +54,21 @@
>      binutils_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
>      binutils_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
>      binutils_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
> +    binutils_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-build-${CT_HOST}" )
> +    binutils_opts+=( "binutils_src=${CT_SRC_DIR}/binutils-${CT_BINUTILS_VERSION}" )

The last two should be in the "if FLAT ... fi" block: ...

>      do_binutils_backend "${binutils_opts[@]}"
>  
>      CT_Popd
> +    
> +    if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
> +        CT_mkdir_pushd "${CT_BUILD_DIR}/build-elf2flt-build-${CT_BUILD}"

... here.

> +        do_elf2flt_backend "${binutils_opts[@]}"
> +         
> +        CT_Popd
> +    fi
> +    
>      CT_EndStep
>  }
>  
> @@ -52,7 +76,7 @@
>  do_binutils_for_host() {
>      local -a binutils_tools
>      local -a binutils_opts
> -
> +    

Space-damage.

>      CT_DoStep INFO "Installing binutils for host"
>      CT_mkdir_pushd "${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}"
>  
> @@ -62,9 +86,20 @@
>      binutils_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
>      binutils_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
>      binutils_opts+=( "build_manuals=${CT_BUILD_MANUALS}" )
> +    binutils_opts+=( "binutils_bld=${CT_BUILD_DIR}/build-binutils-host-${CT_HOST}" )

You forgot binutils_src
Ditto, should be in the "if FLAT ... fi" block, below...

>      do_binutils_backend "${binutils_opts[@]}"
>  
> +    CT_Popd
> +
> +    if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
> +        CT_mkdir_pushd "${CT_BUILD_DIR}/build-elf2flt-host-${CT_HOST}"

... here.

> +        do_elf2flt_backend "${binutils_opts[@]}"
> +        
> +        CT_Popd
> +    fi
> +    
>      # Make those new tools available to the core C compilers to come.
>      # Note: some components want the ${TARGET}-{ar,as,ld,strip} commands as
>      # well. Create that.
> @@ -73,6 +108,9 @@
>      case "${CT_TOOLCHAIN_TYPE}" in
>          cross|native)
>              binutils_tools=( ar as ld strip )
> +            if [ -n "${CT_ARCH_BINFMT_FLAT}" ]; then
> +                binutils_tools+=( elf2flt flthdr )
> +            fi

Exactly! :-)

>              case "${CT_BINUTILS_LINKERS_LIST}" in
>                  ld)         binutils_tools+=( ld.bfd ) ;;
>                  gold)       binutils_tools+=( ld.gold ) ;;
> @@ -218,6 +255,50 @@
>      fi
>  }
>  
> +# Build elf2flt for X -> target
> +#     Parameter     : description               : type      : default
> +#     host          : machine to run on         : tuple     : (none)
> +#     prefix        : prefix to install into    : dir       : (none)
> +#     static_build  : build statcially          : bool      : no
> +#     cflags        : cflags to use             : string    : (empty)
> +#     ldflags       : ldflags to use            : string    : (empty)

Also, binutils_src and binutils_bld.

[--SNIP--]

All in all, that's OK.
I'll do the split + misc fixes here. No need to resend.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* binutils/sstrip: remove
  2012-11-19 10:22 [PATCH 1 of 2] Remove sstrip (obsolete) Yann Diorcet
  2012-11-19 10:22 ` [PATCH 2 of 2] Rework binutils in order to provide soon binutils alternative Yann Diorcet
  2012-11-19 18:23 ` [PATCH 1 of 2] Remove sstrip (obsolete) Yann E. MORIN
@ 2012-11-19 21:28 ` Yann E. MORIN
  2 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2012-11-19 21:28 UTC (permalink / raw)
  To: Yann Diorcet; +Cc: crossgcc

Yann, All,

Your patch:
    binutils/sstrip: remove

has been applied as: #2b64e1b502cd
    http://crosstool-ng.org/hg/crosstool-ng/rev/2b64e1b502cd

Thank you!

Regards,
Yann E. MORIN.



--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* binutils: cleanup ELF/FLAT/FDPIC dependencies
  2012-11-19 10:22 ` [PATCH 2 of 2] Rework binutils in order to provide soon binutils alternative Yann Diorcet
  2012-11-19 18:58   ` Yann E. MORIN
  2012-11-19 23:49   ` binutils/binutils: simplify gold dependencies Yann E. MORIN
@ 2012-11-19 23:49   ` Yann E. MORIN
  2012-11-19 23:49   ` binutils: introduce the infrastructure to support binutils alternatives Yann E. MORIN
  3 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2012-11-19 23:49 UTC (permalink / raw)
  To: Yann Diorcet, Yann E. MORIN; +Cc: crossgcc

Yann, All,

Your patch:
    binutils: cleanup ELF/FLAT/FDPIC dependencies

has been applied as: #f32c0f8ffaa3
    http://crosstool-ng.org/hg/crosstool-ng/rev/f32c0f8ffaa3

Thank you!

Regards,
Yann E. MORIN.



--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* binutils/binutils: simplify gold dependencies
  2012-11-19 10:22 ` [PATCH 2 of 2] Rework binutils in order to provide soon binutils alternative Yann Diorcet
  2012-11-19 18:58   ` Yann E. MORIN
@ 2012-11-19 23:49   ` Yann E. MORIN
  2012-11-19 23:49   ` binutils: cleanup ELF/FLAT/FDPIC dependencies Yann E. MORIN
  2012-11-19 23:49   ` binutils: introduce the infrastructure to support binutils alternatives Yann E. MORIN
  3 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2012-11-19 23:49 UTC (permalink / raw)
  To: Yann Diorcet, Yann E. MORIN; +Cc: crossgcc

Yann, All,

Your patch:
    binutils/binutils: simplify gold dependencies

has been applied as: #5016315d88ba
    http://crosstool-ng.org/hg/crosstool-ng/rev/5016315d88ba

Thank you!

Regards,
Yann E. MORIN.



--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* binutils: introduce the infrastructure to support binutils alternatives
  2012-11-19 10:22 ` [PATCH 2 of 2] Rework binutils in order to provide soon binutils alternative Yann Diorcet
                     ` (2 preceding siblings ...)
  2012-11-19 23:49   ` binutils: cleanup ELF/FLAT/FDPIC dependencies Yann E. MORIN
@ 2012-11-19 23:49   ` Yann E. MORIN
  3 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2012-11-19 23:49 UTC (permalink / raw)
  To: Yann Diorcet, Yann E. MORIN; +Cc: crossgcc

Yann, All,

Your patch:
    binutils: introduce the infrastructure to support binutils alternatives

has been applied as: #6a5946fbc728
    http://crosstool-ng.org/hg/crosstool-ng/rev/6a5946fbc728

Thank you!

Regards,
Yann E. MORIN.



--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

end of thread, other threads:[~2012-11-19 23:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-19 10:22 [PATCH 1 of 2] Remove sstrip (obsolete) Yann Diorcet
2012-11-19 10:22 ` [PATCH 2 of 2] Rework binutils in order to provide soon binutils alternative Yann Diorcet
2012-11-19 18:58   ` Yann E. MORIN
2012-11-19 23:49   ` binutils/binutils: simplify gold dependencies Yann E. MORIN
2012-11-19 23:49   ` binutils: cleanup ELF/FLAT/FDPIC dependencies Yann E. MORIN
2012-11-19 23:49   ` binutils: introduce the infrastructure to support binutils alternatives Yann E. MORIN
2012-11-19 18:23 ` [PATCH 1 of 2] Remove sstrip (obsolete) Yann E. MORIN
2012-11-19 21:28 ` binutils/sstrip: remove Yann E. MORIN

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 read-only IMAP folder(s) and NNTP newsgroup(s).