add crosstools-ng snapshot

This commit is contained in:
Solomon Peachy 2013-08-03 12:39:47 -04:00
parent 87fe42acc9
commit e75a34604a
1380 changed files with 235366 additions and 0 deletions

38
crosstool-ng/.hgignore Normal file
View File

@ -0,0 +1,38 @@
syntax: glob
# Generated files
configure
autom4te.cache
config.log
config.status
Makefile
*ct-ng*
docs/*ct-ng*.1
docs/*ct-ng*.1.gz
paths.mk
paths.sh
scripts/crosstool-NG.sh
scripts/saveSample.sh
scripts/showTuple.sh
kconfig/conf
kconfig/?conf
kconfig/**.o
kconfig/**.dep
kconfig/lex.backup
kconfig/lex.zconf.c
kconfig/zconf.hash.c
kconfig/zconf.tab.c
config/configure.in
config.gen/
.config
.config.2
# Temporaries
.*.swp
build.log
.config.old
# This is the place where toolchains are built
.build/
# .. and the legacy location
targets/

32
crosstool-ng/.hgtags Normal file
View File

@ -0,0 +1,32 @@
1161124240eecdd9985ed8bb1f656f73e11ac7f5 crosstool-ng-1.0.0
1853cda9d5fcc8f00c1b8825a3cdd35ab186f5a2 crosstool-ng-1.4.1
1ee5aab4c728e9af94d978c6beb722804ec6445e crosstool-ng-0.1.1
26c0b9e2925f2517d1e245c2f851195926e55402 crosstool-ng-1.2.4
29233430562ffa6fa2c6c1231df0a42893ed1a8d crosstool-ng-1.1.2
2be7232a73ac3fe09d2fb73b9c01678d3b14e577 crosstool-ng-0.2.2
30c199c6c1d883bce387079c5008f6fc88575ad4 crosstool-ng-1.2.5
35aaf07763d1e5d0736ca32e307e6c1d6a54947a crosstool-ng-1.1.3
39b1c755f19bfd5b714ca85cc7640d976dcefdff crosstool-ng-1.4.0
4150b61102e471c4fbc08f107e863505eff77864 crosstool-ng-1.3.3
535c6e0a057c64a88b5bba9a3f57f2bbff5657c3 crosstool-ng-1.3.0
565d6d12f13974dbec80ae83c9af8311d7baa845 crosstool-ng-0.0.1
5d14c00467ab59eabe9b1066f3d32fb893c2cda3 crosstool-ng-0.2.0
60e62e0a90e249fc010065838e0c5be96d744af7 crosstool-ng-0.0.5
696c97af4379cdcdaad1ac14875385cfeee8ca00 crosstool-ng-0.3.1
6ca745eb9aaa1a91cb3721210749d1105a6b1b81 crosstool-ng-0.2.1
6d8384a866925ab311d1c096e260512752f22528 crosstool-ng-0.3.2
6ed7374c84784e677bbfcbb783bc14db619e9205 crosstool-ng-1.3.1
6f4ad1b466b57c90259f82e4540df21e99a99881 crosstool-ng-1.2.2
78e3bf9373e2d80c0ffde27f9462b12cfe787eb6 crosstool-ng-1.3.2
8031c8ac452a2d3e66862f914127831c1dca895e crosstool-ng-1.1.1
8451e5083069718465430c6fe7b3e0b192f40d75 crosstool-ng-1.2.0
88cc5f5c0807c349e37d889b4ad58ede4f09ee68 crosstool-ng-0.1.2
a393e449f6ba3987298a1154ca48b15c8f66f2fa crosstool-ng-0.0.3
a44f2ee18392a60c6097c32dbd7ad28dc67e28fe crosstool-ng-1.1.0
a8cd2d0d06bd0a9233c897c165bd8dfc927fa317 crosstool-ng-0.3.0
b48b98717e16ebb58235c106e048bad729e79bbb crosstool-ng-1.2.1
b8de3e11c8b49fd290c15e576cd6611db35ab3dd crosstool-ng-1.2.3
c71b4f4da4b46aa83e6c013208731edfffd249a1 crosstool-ng-0.0.4
ce34b7cd6509906de6885c084dbef7ddecd603c6 crosstool-ng-1.1.3a
e016efb7036c14f86e1592114e621cfadeaf714c crosstool-ng-0.0.2
fec15dd785b1ab52e15a350665362c3f58852931 crosstool-ng-0.1.0

1
crosstool-ng/.version Normal file
View File

@ -0,0 +1 @@
hg

48
crosstool-ng/COPYING Normal file
View File

@ -0,0 +1,48 @@
Unless otherwise stated in individual files, this work is licensed to you under
the following terms.
- Files in docs/ are available under the Creative Commons Attribution, Share
Alike (by-sa), v2.5, to be found there:
licenses.d/by-sa/deed.en (human-readable summary)
licenses.d/by-sa/legalcode (legal code, the full license)
- Files found in patches/*/ are available under the same license as the
upstream software they apply to.
That means that you can't use those patches if you were licensed the
software under a specific license which is not the one the software is
commonly available under.
As an example, if you ever managed to get the Linux kernel under a license
other than the GPLv2, you are not allowed to use the Linux kernel patches
coming with crosstool-NG, as those are available under the GPLv2, which is
the license the Linux kernel is most commonly available under.
As a convenience, the GNU Lesser General Public License (LGPL) v2.1 (for the
patches against glibc, uClibc, and some other libraries) is available there:
licenses.d/lgpl.txt
- Other files not covered by the above licenses, and not covered by an
individual license specified in the file itself, or an accompanying file,
are available under the GNU General Public License (GPL), v2, to be found
here:
licenses.d/gpl.txt
- Also, I want to clarify one point. If you build a toolchain with crosstool-NG
and you happen to sell, deliver, or otherwise publish this toolchain to a
third party, I consider crosstool-NG as being part of the sources needed to
rebuild the afore-mentioned toolchain, alongside with all other source code
that third party is otherwise entitled to receive, due to other licenses of
the different components. See licenses.d/gpl.txt, section 3, which reads:
> For an executable work, complete source code means [...], plus the
> scripts used to control compilation and installation of the executable.
In short: crosstool-NG is the part refered to as "the scripts to control
compilation and installation of the executable", it being the toolchain in
our case; and as such you must make it available, in conformance to the
GPLv2, see above.
Also, if you have local patches that you apply to the different components
(either manualy, or by instructing crosstool-NG to do so), you will have to
make those patches available alongside with your toolchain, to comply with
the licenses of the components impacted by your patches.

1
crosstool-ng/LICENSES Symbolic link
View File

@ -0,0 +1 @@
COPYING

403
crosstool-ng/Makefile.in Normal file
View File

@ -0,0 +1,403 @@
# Makefile.in for building crosstool-NG
# This file serves as source for the ./configure operation
# This series of test is here because GNU make 3.81 will *not* use MAKEFLAGS
# to set additional flags in the current Makfile ( see:
# http://savannah.gnu.org/bugs/?20501 ), although the make manual says it
# should ( see: http://www.gnu.org/software/make/manual/make.html#Options_002fRecursion )
# so we have to work it around by calling ourselves back if needed
# So why do we need not to use the built rules and variables? Because we
# need to generate scripts/crosstool-NG.sh from scripts/crosstool-NG.sh.in
# and there is a built-in implicit rule '%.sh:' that has neither a pre-requisite
# nor a command associated, and that built-in implicit rule takes precedence
# over our non-built-in implicit rule '%: %.in', below.
# CT_MAKEFLAGS will be used later, below...
# Do not print directories as we descend into them
ifeq ($(filter --no-print-directory,$(MAKEFLAGS)),)
CT_MAKEFLAGS += --no-print-directory
endif
# Use neither builtin rules, nor builtin variables
# Note: dual test, because if -R and -r are given on the command line
# (who knows?), MAKEFLAGS contains 'Rr' instead of '-Rr', while adding
# '-Rr' to MAKEFLAGS adds it literaly ( and does not add 'Rr' )
# Further: quad test because the flags 'rR' and '-rR' can be reordered.
ifeq ($(filter Rr,$(MAKEFLAGS)),)
ifeq ($(filter -Rr,$(MAKEFLAGS)),)
ifeq ($(filter rR,$(MAKEFLAGS)),)
ifeq ($(filter -rR,$(MAKEFLAGS)),)
CT_MAKEFLAGS += -Rr
endif # No -rR
endif # No rR
endif # No -Rr
endif # No Rr
# Remove any suffix rules
.SUFFIXES:
all: Makefile build
###############################################################################
# Configuration variables
# Stuff found by ./configure
export DATE := @DATE@
export LOCAL := @enable_local@
export PROG_SED := @program_transform_name@
export PACKAGE_TARNAME := @PACKAGE_TARNAME@
export VERSION := @PACKAGE_VERSION@
export prefix := @prefix@
export exec_prefix := @exec_prefix@
export bindir := @bindir@
export libdir := @libdir@@sublibdir@
export docdir := @docdir@@subdocdir@
export mandir := @mandir@
export datarootdir := @datarootdir@
export install := @INSTALL@
export bash := @_BASH@
export awk := @_AWK@
export grep := @GREP@
export make := @MAKE@
export sed := @SED@
export libtool := @LIBTOOL@
export libtoolize := @LIBTOOLIZE@
export objcopy := @OBJCOPY@
export objdump := @OBJDUMP@
export readelf := @READELF@
export patch := @PATCH@
export CC := @CC@
export CPP := @CPP@
export CPPFLAGS := @CPPFLAGS@
export CFLAGS := @CFLAGS@
export LDFLAGS := @LDFLAGS@
export LIBS := @LIBS@
export curses_hdr := @ac_ct_curses_hdr@
export gettext := @gettext@
# config options to push down to kconfig
KCONFIG:= @kconfig_options@
###############################################################################
# Non-configure variables
MAN_SECTION := 1
MAN_SUBDIR := /man$(MAN_SECTION)
PROG_NAME := $(shell echo 'ct-ng' |$(sed) -r -e '$(PROG_SED)' )
###############################################################################
# Sanity checks
# Check if Makefile is up to date:
Makefile: Makefile.in
@echo "$< did changed: you must re-run './configure'"
@false
# If installing with DESTDIR, check it's an absolute path
ifneq ($(strip $(DESTDIR)),)
ifneq ($(DESTDIR),$(abspath /$(DESTDIR)))
$(error DESTDIR is not an absolute PATH: '$(DESTDIR)')
endif
endif
###############################################################################
# Global make rules
# If any extra MAKEFLAGS were added, re-run ourselves
# See top of file for an explanation of why this is needed...
ifneq ($(strip $(CT_MAKEFLAGS)),)
# Somehow, the new auto-completion for make in the recent distributions
# trigger a behavior where our Makefile calls itself recursively, in a
# never-ending loop (except on lack of ressources, swap, PIDs...)
# Avoid this situation by cutting the recursion short at the first
# level.
# This has the side effect of only showing the real targets, and hiding our
# internal ones. :-)
ifneq ($(MAKELEVEL),0)
$(error Recursion detected, bailing out...)
endif
MAKEFLAGS += $(CT_MAKEFLAGS)
build install clean distclean mrproper uninstall:
@$(MAKE) $@
else
# There were no additional MAKEFLAGS to add, do the job
TARGETS := bin lib lib-kconfig doc man
build: $(patsubst %,build-%,$(TARGETS))
install: build real-install
clean: $(patsubst %,clean-%,$(TARGETS))
distclean: clean
@echo " RM 'Makefile'"
@rm -f Makefile
mrproper: distclean
@echo " RM 'autostuff'"
@ rm -rf autom4te.cache config.log config.status configure
uninstall: real-uninstall
###############################################################################
# Specific make rules
#--------------------------------------
# Build rules
build-bin: $(PROG_NAME) \
scripts/crosstool-NG.sh \
scripts/saveSample.sh \
scripts/showTuple.sh
@chmod 755 $^
build-lib: config/configure.in \
paths.mk \
paths.sh
build-lib-kconfig:
@$(MAKE) -C kconfig
build-doc:
build-man: docs/$(PROG_NAME).1.gz
docs/$(PROG_NAME).1.gz: docs/$(PROG_NAME).1
@echo " GZIP '$@'"
@gzip -c9 $< >$@
define sed_it
@echo " SED '$@'"
@$(sed) -r -e 's,@@CT_BINDIR@@,$(bindir),g;' \
-e 's,@@CT_LIBDIR@@,$(libdir),g;' \
-e 's,@@CT_DOCDIR@@,$(docdir),g;' \
-e 's,@@CT_MANDIR@@,$(mandir),g;' \
-e 's,@@CT_PROG_NAME@@,$(PROG_NAME),g;' \
-e 's,@@CT_VERSION@@,$(VERSION),g;' \
-e 's,@@CT_DATE@@,$(DATE),g;' \
-e 's,@@CT_make@@,$(make),g;' \
-e 's,@@CT_bash@@,$(bash),g;' \
-e 's,@@CT_awk@@,$(awk),g;' \
$< >$@
endef
docs/$(PROG_NAME).1: docs/ct-ng.1.in Makefile
$(call sed_it)
$(PROG_NAME): ct-ng.in Makefile
$(call sed_it)
%: %.in Makefile
$(call sed_it)
# We create a script fragment that is parseable from inside a Makefile,
# and one from inside a shell script
paths.mk: FORCE
@echo " GEN '$@'"
@(echo 'export install=$(install)'; \
echo 'export bash=$(bash)'; \
echo 'export awk=$(awk)'; \
echo 'export grep=$(grep)'; \
echo 'export make=$(make)'; \
echo 'export sed=$(sed)'; \
echo 'export libtool=$(libtool)'; \
echo 'export libtoolize=$(libtoolize)'; \
echo 'export objcopy=$(objcopy)'; \
echo 'export objdump=$(objdump)'; \
echo 'export readelf=$(readelf)'; \
echo 'export patch=$(patch)'; \
) >$@
paths.sh: FORCE
@echo " GEN '$@'"
@(echo 'export install="$(install)"'; \
echo 'export bash="$(bash)"'; \
echo 'export awk="$(awk)"'; \
echo 'export grep="$(grep)"'; \
echo 'export make="$(make)"'; \
echo 'export sed="$(sed)"'; \
echo 'export libtool="$(libtool)"'; \
echo 'export libtoolize="$(libtoolize)"'; \
echo 'export objcopy="$(objcopy)"'; \
echo 'export objdump="$(objdump)"'; \
echo 'export readelf="$(readelf)"'; \
echo 'export patch="$(patch)"'; \
) >$@
config/configure.in: FORCE
@echo " GEN '$@'"
@{ printf "# Generated file, do not edit\n"; \
printf "# Default values as found by ./configure\n"; \
for var in $(KCONFIG); do \
printf "\n"; \
printf "config CONFIGURE_$${var%%=*}\n"; \
if [ "$${var#*=}" = "y" ]; then \
printf " def_bool y\n"; \
else \
printf " bool\n"; \
fi; \
done; \
} >$@
FORCE:
#--------------------------------------
# Clean rules
clean-bin:
@echo " RM '$(PROG_NAME)'"
@rm -f $(PROG_NAME)
@echo " RM 'scripts/crosstool-NG.sh'"
@rm -f scripts/crosstool-NG.sh
@echo " RM 'scripts/saveSample.sh'"
@rm -f scripts/saveSample.sh
@echo " RM 'scripts/showTuple.sh'"
@rm -f scripts/showTuple.sh
clean-lib:
@echo " RM 'paths'"
@rm -f paths.mk paths.sh
@echo " RM 'config/configure.in'"
@rm -f config/configure.in
clean-lib-kconfig:
@$(MAKE) -C kconfig clean
clean-doc:
clean-man:
@echo " RM 'docs/$(PROG_NAME).1'"
@rm -f docs/$(PROG_NAME).1
@echo " RM 'docs/$(PROG_NAME).1.gz'"
@rm -f docs/$(PROG_NAME).1.gz
#--------------------------------------
# Check for --local setup
ifeq ($(strip $(LOCAL)),yes)
real-install:
@true
real-uninstall:
@true
else
#--------------------------------------
# Install rules
real-install: $(patsubst %,install-%,$(TARGETS)) install-post
install-bin: $(DESTDIR)$(bindir)
@echo " INST '$(PROG_NAME)'"
@$(install) -m 755 $(PROG_NAME) "$(DESTDIR)$(bindir)/$(PROG_NAME)"
# If one is hacking crosstool-NG, the patch set might change between any two
# installations of the same VERSION, thus the patches must be removed prior
# to being installed. It is the responsibility of the user to call uninstall
# first, if (s)he deems it necessary
install-lib: $(DESTDIR)$(libdir) \
install-lib-main \
install-lib-samples
LIB_SUB_DIR := config contrib patches scripts
$(patsubst %,install-lib-%-copy,$(LIB_SUB_DIR)): $(DESTDIR)$(libdir)
@echo " INSTDIR '$(patsubst install-lib-%-copy,%,$(@))/'"
@tar cf - --exclude='*.sh.in' $(patsubst install-lib-%-copy,%,$(@)) \
|(cd "$(DESTDIR)$(libdir)"; tar xf -)
# Huh? It seems we need at least one command to make this rule kick-in.
install-lib-%: install-lib-%-copy; @true
# Huh? that one does not inherit the -opy dependency, above...
install-lib-scripts: install-lib-scripts-copy
@chmod a+x $(DESTDIR)$(libdir)/scripts/crosstool-NG.sh
@chmod a+x $(DESTDIR)$(libdir)/scripts/saveSample.sh
@rm -f "$(DESTDIR)$(libdir)/scripts/addToolVersion.sh"
install-lib-main: $(DESTDIR)$(libdir) $(patsubst %,install-lib-%,$(LIB_SUB_DIR))
@echo " INST 'steps.mk'"
@$(install) -m 644 steps.mk "$(DESTDIR)$(libdir)/steps.mk"
@echo " INST 'paths'"
@$(install) -m 644 paths.mk paths.sh "$(DESTDIR)$(libdir)"
# Samples need a little love:
# - change every occurrence of CT_TOP_DIR to CT_LIB_DIR
install-lib-samples: $(DESTDIR)$(libdir) install-lib-main
@echo " INSTDIR 'samples/'"
@for samp_dir in samples/*/; do \
mkdir -p "$(DESTDIR)$(libdir)/$${samp_dir}"; \
$(sed) -r -e 's:\$$\{CT_TOP_DIR\}:\$$\{CT_LIB_DIR\}:;' \
-e 's:^(CT_WORK_DIR)=.*:\1="\$${CT_TOP_DIR}/.build":;' \
$${samp_dir}/crosstool.config \
>"$(DESTDIR)$(libdir)/$${samp_dir}/crosstool.config"; \
$(install) -m 644 "$${samp_dir}/reported.by" \
"$(DESTDIR)$(libdir)/$${samp_dir}"; \
for libc_cfg in "$${samp_dir}/"*libc*.config; do \
[ -f "$${libc_cfg}" ] || continue; \
$(install) -m 644 "$${libc_cfg}" \
"$(DESTDIR)$(libdir)/$${samp_dir}"; \
done; \
done
@$(install) -m 644 samples/samples.mk "$(DESTDIR)$(libdir)/samples/samples.mk"
KCONFIG_FILES := conf mconf nconf kconfig.mk
install-lib-kconfig: $(DESTDIR)$(libdir) install-lib-main
@echo " INST 'kconfig/'"
@mkdir -p "$(DESTDIR)$(libdir)/kconfig"
@for f in $(KCONFIG_FILES); do \
install "kconfig/$${f}" "$(DESTDIR)$(libdir)/kconfig/$${f}"; \
done
install-doc: $(DESTDIR)$(docdir)
@echo " INST 'docs/*.txt'"
@for doc_file in docs/*.txt; do \
$(install) -m 644 "$${doc_file}" "$(DESTDIR)$(docdir)"; \
done
install-man: $(DESTDIR)$(mandir)$(MAN_SUBDIR)
@echo " INST '$(PROG_NAME).1.gz'"
@$(install) -m 644 docs/$(PROG_NAME).1.gz "$(DESTDIR)$(mandir)$(MAN_SUBDIR)"
$(sort $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(docdir) $(DESTDIR)$(mandir)$(MAN_SUBDIR)):
@echo " MKDIR '$@/'"
@$(install) -m 755 -d "$@"
install-post:
@echo
@echo "For auto-completion, do not forget to install '$(PROG_NAME).comp' into"
@echo "your bash completion directory (usually /etc/bash_completion.d)"
#--------------------------------------
# Uninstall rules
real-uninstall: $(patsubst %,uninstall-%,$(TARGETS))
uninstall-bin:
@echo " RM '$(DESTDIR)$(bindir)/$(PROG_NAME)'"
@rm -f "$(DESTDIR)$(bindir)/$(PROG_NAME)"
uninstall-lib:
@echo " RMDIR '$(DESTDIR)$(libdir)/'"
@rm -rf "$(DESTDIR)$(libdir)"
uninstall-doc:
@echo " RMDIR '$(DESTDIR)$(docdir)/'"
@rm -rf "$(DESTDIR)$(docdir)"
uninstall-man:
@echo " RM '$(DESTDIR)$(mandir)$(MAN_SUBDIR)/$(PROG_NAME).1.gz'"
@rm -f "$(DESTDIR)$(mandir)$(MAN_SUBDIR)/$(PROG_NAME).1"{,.gz}
endif # Not --local
endif # No extra MAKEFLAGS were added
.PHONY: build $(patsubst %,build-%,$(TARGETS)) install

29
crosstool-ng/README Normal file
View File

@ -0,0 +1,29 @@
This is the README for crosstool-NG
Crosstool-NG follows the autoconf dance. So, to get you
kick-started, just run:
./configure --help
If you are using a development snapshot, you'll have to
create the configure script, first. Just run:
./bootstrap
You will find the documentation in the directory 'docs'.
Here is a quick overview of what you'll find there:
0 - Table of content
1 - Introduction
2 - Installing crosstool-NG
3 - Configuring a toolchain
4 - Building the toolchain
5 - Using the toolchain
6 - Toolchain types
7 - Contributing
8 - Internals
A - Credits
B - Known issues
C - Misc. tutorials
You can also point your browser at:
http://crosstool-ng.org/
Aloha!

35
crosstool-ng/TODO Normal file
View File

@ -0,0 +1,35 @@
This is a somewhat ordered TODO list:
Recurring tasks:
- update versions for every tools...
- update and/or upgrade all samples
Non-recurring tasks:
- update newlib (for enhanced bare metal)
- confirm existing implementation on targets other than AVR32
- try to make it generic, will help for uClibc++
- multilib
- Cygwin target (needs newlib)
- so we can build toolchains that generate code for Windows/Cygwin
- Cygwin host
- so we can build toolchains that run natively under Windows/Cygwin
- mingw32 target
- so we can build toolchains that generate code for Windows/Win32
- mingw32 host
- so we can build toolchains that run natively under Windows/Win32
(without requiring Cygwin)
- uClibc++
- see newlib, above
- uClinux
- check whether we can use newlib under uClinux (?)

7
crosstool-ng/bootstrap Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
set -e
printf "Running autoconf...\n"
autoconf -Wall --force
printf "Done. You may now run:\n ./configure\n"

7124
crosstool-ng/configure vendored Executable file

File diff suppressed because it is too large Load Diff

377
crosstool-ng/configure.ac Normal file
View File

@ -0,0 +1,377 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.67])
#AC_INIT([crosstool-NG], [hg], [crossgcc@sourceware.org])
AC_INIT([crosstool-NG], [m4_esyscmd_s([cat .version])], [crossgcc@sourceware.org])
AC_CONFIG_AUX_DIR([scripts])
#--------------------------------------------------------------------
# A few helper macros
# Check for required tool
AC_DEFUN(
[ACX_CHECK_TOOL_REQ],
[AC_CHECK_TOOLS([$1], [$2])
AS_IF(
[test -z "$$1"],
[AC_MSG_ERROR([missing required tool: $2])])
])
# Check for required tool, set variable to full pathname
AC_DEFUN(
[ACX_PATH_TOOL_REQ],
[ACX_CHECK_TOOL_REQ([$1], [$2])
AS_CASE(
[$$1],
[/*],,
[?*],[AC_MSG_CHECKING([for absolute path to $$1])
$1=$(which $$1)
AC_MSG_RESULT([$$1])])])
# Check for required program
AC_DEFUN(
[ACX_CHECK_PROGS_REQ],
[AC_CHECK_PROGS([$1], [$2])
AS_IF(
[test -z "$$1"],
[AC_MSG_ERROR([missing required tool: $2])])
])
# Check for path to required program
AC_DEFUN(
[ACX_PATH_PROGS_REQ],
[AC_PATH_PROGS([$1], [$2])
AS_IF(
[test -z "$$1"],
[AC_MSG_ERROR([missing required tool: $2])])
])
# Set the kconfig option
AC_DEFUN(
[ACX_SET_KCONFIG_OPTION],
[AS_IF(
[test -n "$$1"],
[kconfig_options="$kconfig_options has_$1=y"],
[kconfig_options="$kconfig_options has_$1"])
])
#--------------------------------------------------------------------
# Allow dummy --{en,dis}able-{static,shared}
AC_ARG_ENABLE(
[local],
[AS_HELP_STRING(
[--enable-local],
[don't install, and use current directory])])
AC_SUBST([enable_local], [${enable_local:-no}])
AC_ARG_ENABLE(
[shared],
[AS_HELP_STRING(
[--enable-shared],
[build shared libraries (default=yes) (ignored)])])
AC_ARG_ENABLE(
[static],
[AS_HELP_STRING(
[--enable-static],
[build static libraries (default=yes) (ignored)])])
#---------------------------------------------------------------------
# Check for --build and --host...
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
# ... but refuse --target
AS_IF([test -n "$target_alias"],
AC_MSG_ERROR([--target is not allowed]))
# Allow program name tranformation (--program-{prefix,suffix,transform-name})
AC_ARG_PROGRAM
#---------------------------------------------------------------------
# Initial checks that are usually done first (I don't know why, that's
# just what I seem to experience...)
#---------------------------------------------------------------------
AC_ARG_WITH([install],
AS_HELP_STRING([--with-install=PATH],
[Specify the full PATH to a BSD-compatible install]),
[INSTALL=$withval])
AC_PROG_INSTALL
AC_PROG_GREP
AC_PROG_EGREP
AS_IF(
[test ! "$EGREP" = "$GREP -E"],
[AC_MSG_ERROR([egrep is not $GREP -E])])
AC_CACHE_VAL([ac_cv_path_SED],
[AC_ARG_WITH([sed],
AS_HELP_STRING([--with-sed=PATH],
[Specify the full PATH to GNU sed]),
[ac_cv_path_SED=$withval])])
AC_PROG_SED
AC_MSG_CHECKING([whether sed understands -r -i -e])
touch .ct-ng.sed.test
if ${SED} -r -i -e 's/foo/bar/' .ct-ng.sed.test >/dev/null 2>&1; then
rm -f .ct-ng.sed.test
AC_MSG_RESULT([yes])
else
rm -f .ct-ng.sed.test
AC_MSG_RESULT([no])
AC_MSG_ERROR()
fi
AC_PROG_LN_S
#--------------------------------------------------------------------
# A bunch of boring tests...
#--------------------------------------------------------------------
AC_PROG_CC
AS_IF([test -z "$CC"],
[AC_MSG_ERROR([no suitable compiler found])])
AC_PROG_CPP
# But we still need a way to specify the PATH to GNU versions (Damn MacOS)
AC_ARG_WITH([objcopy],
AS_HELP_STRING([--with-objcopy=PATH],
[Specify the full PATH to GNU objcopy]),
[OBJCOPY=$withval])
AC_ARG_WITH([objdump],
AS_HELP_STRING([--with-objdump=PATH],
[Specify the full PATH to GNU objdump]),
[OBJDUMP=$withval])
AC_ARG_WITH([ranlib],
AS_HELP_STRING([--with-ranlib=PATH],
[Specify the full PATH to GNU ranlib]),
[RANLIB=$withval])
AC_ARG_WITH([readelf],
AS_HELP_STRING([--with-readelf=PATH],
[Specify the full PATH to GNU readelf]),
[READELF=$withval])
AC_PROG_RANLIB
ACX_PATH_TOOL_REQ([OBJCOPY], [objcopy])
ACX_PATH_TOOL_REQ([OBJDUMP], [objdump])
ACX_PATH_TOOL_REQ([READELF], [readelf])
ACX_CHECK_PROGS_REQ([bison], [bison])
ACX_CHECK_PROGS_REQ([flex], [flex])
ACX_CHECK_PROGS_REQ([gperf], [gperf])
ACX_CHECK_PROGS_REQ([makeinfo], [makeinfo])
ACX_CHECK_PROGS_REQ([cut], [cut])
ACX_CHECK_PROGS_REQ([stat], [stat])
ACX_CHECK_PROGS_REQ([readlink], [readlink])
ACX_CHECK_PROGS_REQ([wget], [wget])
ACX_CHECK_PROGS_REQ([tar], [tar])
ACX_CHECK_PROGS_REQ([gzip], [gzip])
ACX_CHECK_PROGS_REQ([bzip2], [bzip2])
#--------------------------------------------------------------------
# Still boring, but remember the path, now...
#--------------------------------------------------------------------
ACX_PATH_PROGS_REQ([PATCH], [patch])
#--------------------------------------------------------------------
# And a bunch of less boring tests...
#--------------------------------------------------------------------
# We need a bash that is >= 3.1
AC_CACHE_VAL([ac_cv_path__BASH],
[AC_ARG_WITH([bash],
AS_HELP_STRING([--with-bash=PATH],
[Specify the full PATH to GNU bash >= 3.1]),
[ac_cv_path__BASH=$withval])])
AC_CACHE_CHECK([for bash >= 3.1], [ac_cv_path__BASH],
[AC_PATH_PROGS_FEATURE_CHECK([_BASH], [bash],
[[_BASH_ver=$($ac_path__BASH --version 2>&1 \
|$EGREP '^GNU bash, version (3\.[1-9]|4)')
test -n "$_BASH_ver" && ac_cv_path__BASH=$ac_path__BASH ac_path__BASH_found=:]],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([could not find bash >= 3.1])])])
AC_SUBST([_BASH], [$ac_cv_path__BASH])
# We need a awk that *is* GNU awk
AC_CACHE_VAL([ac_cv_path__AWK],
[AC_ARG_WITH([awk],
AS_HELP_STRING([--with-awk=PATH],
[Specify the full PATH to GNU awk]),
[ac_cv_path__AWK=$withval])])
AC_CACHE_CHECK([for GNU awk], [ac_cv_path__AWK],
[AC_PATH_PROGS_FEATURE_CHECK([_AWK], [awk gawk],
[[_AWK_ver=$($ac_path__AWK --version 2>&1 \
|$EGREP '^GNU Awk ')
test -n "$_AWK_ver" && ac_cv_path__AWK=$ac_path__AWK ac_path__AWK_found=:]],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([could not find GNU awk])])])
AC_SUBST([_AWK], [$ac_cv_path__AWK])
#----------------------------------------
# Check for GNU make 3.80 or above
AC_CACHE_VAL([ac_cv_path_MAKE],
[AC_ARG_WITH([make],
AS_HELP_STRING([--with-make=PATH],
[Specify the full PATH to GNU make >= 3.80]),
[ac_cv_path_MAKE=$withval])])
AC_CACHE_CHECK([for GNU make >= 3.80], [ac_cv_path_MAKE],
[AC_PATH_PROGS_FEATURE_CHECK([MAKE], [make gmake],
[[MAKE_ver=$($ac_path_MAKE --version 2>&1 \
|$EGREP '^GNU Make (3.[89][[:digit:]]|[4-9])')
test -n "$MAKE_ver" && ac_cv_path_MAKE=$ac_path_MAKE ac_path_MAKE_found=:]],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([could not find GNU make >= 3.80])])])
AC_SUBST([MAKE], [$ac_cv_path_MAKE])
AC_PROG_MAKE_SET
#----------------------------------------
# Check for libtool >= 1.5.26
AC_CACHE_VAL([ac_cv_path_LIBTOOL],
[AC_ARG_WITH([libtool],
AS_HELP_STRING([--with-libtool=PATH],
[Specify the full PATH to GNU libtool >= 1.5.26]),
[ac_cv_path_LIBTOOL=$withval])])
AC_CACHE_CHECK([for GNU libtool >= 1.5.26], [ac_cv_path_LIBTOOL],
[AC_PATH_PROGS_FEATURE_CHECK([LIBTOOL], [libtool],
[[LIBTOOL_ver=$($ac_path_LIBTOOL --version 2>&1 \
|$EGREP '\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)')
test -n "$LIBTOOL_ver" && ac_cv_path_LIBTOOL=$ac_path_LIBTOOL ac_path_LIBTOOL_found=:]],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([could not find GNU libtool >= 1.5.26])])])
AC_SUBST([LIBTOOL], [$ac_cv_path_LIBTOOL])
#----------------------------------------
# Check for libtoolize >= 1.5.26
AC_CACHE_VAL([ac_cv_path_LIBTOOLIZE],
[AC_ARG_WITH([libtoolize],
AS_HELP_STRING([--with-libtoolize=PATH],
[Specify the full PATH to GNU libtoolize >= 1.5.26]),
[ac_cv_path_LIBTOOLIZE=$withval])])
AC_CACHE_CHECK([for GNU libtoolize >= 1.5.26], [ac_cv_path_LIBTOOLIZE],
[AC_PATH_PROGS_FEATURE_CHECK([LIBTOOLIZE], [libtoolize],
[[LIBTOOLIZE_ver=$($ac_path_LIBTOOLIZE --version 2>&1 \
|$EGREP '\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)')
test -n "$LIBTOOLIZE_ver" && ac_cv_path_LIBTOOLIZE=$ac_path_LIBTOOLIZE ac_path_LIBTOOLIZE_found=:]],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([could not find GNU libtoolize >= 1.5.26])])])
AC_SUBST([LIBTOOLIZE], [$ac_cv_path_LIBTOOLIZE])
#----------------------------------------
# Check for automake >= 1.10
AC_CACHE_VAL([ac_cv_path_automake],
[AC_ARG_WITH([automake],
AS_HELP_STRING([--with-automake=PATH],
[Specify the full PATH to GNU automake >= 1.10]),
[ac_cv_path_automake=$withval])])
AC_CACHE_CHECK([for GNU automake >= 1.10], [ac_cv_path_automake],
[AC_PATH_PROGS_FEATURE_CHECK([automake], [automake],
[[automake_ver=$($ac_path_automake --version 2>&1 \
|$EGREP '\(GNU automake\) (1\.[[:digit:]]{2,}|[2-9][[:digit:]]*\.)')
test -n "$automake_ver" && ac_cv_path_automake=$ac_path_automake ac_path_automake_found=:]],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([could not find GNU automake >= 1.10])])])
AC_SUBST([automake], [$ac_cv_path_automake])
#--------------------------------------------------------------------
# Boring again... But still a bit of work to do...
#--------------------------------------------------------------------
AC_SUBST([kconfig_options])
#----------------------------------------
AC_CHECK_PROGS([xz], [xz])
ACX_SET_KCONFIG_OPTION([xz])
AS_IF(
[test -z "$xz"],
[AC_CHECK_PROGS([lzma], [lzma])])
ACX_SET_KCONFIG_OPTION([lzma])
#----------------------------------------
AC_CHECK_PROGS([cvs], [cvs])
ACX_SET_KCONFIG_OPTION([cvs])
#----------------------------------------
AC_CHECK_PROGS([svn], [svn])
ACX_SET_KCONFIG_OPTION([svn])
#--------------------------------------------------------------------
# Now, for some fun...
#--------------------------------------------------------------------
AC_C_INLINE
AC_HEADER_STDC
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_ALLOCA
#----------------------------------------
# Check for gettext, for the kconfig frontends
AC_SUBST([gettext])
AC_CHECK_HEADERS(
[libintl.h],
[ac_ct_gettext_hdr=$ac_header; break])
AS_IF(
[test -n "$ac_ct_gettext_hdr"],
[AC_CHECK_DECL(
[gettext],
[gettext=y],,
[AC_INCLUDES_DEFAULT()
#include <$ac_ct_gettext_hdr>])])
#----------------------------------------
# Check for ncurses, for the kconfig frontends
AC_SUBST([ac_ct_curses_hdr])
AC_CHECK_HEADERS(
[ncurses/ncurses.h ncurses/curses.h ncursesw/curses.h ncurses.h curses.h],
[ac_ct_curses_hdr=$ac_header; break])
AS_IF(
[test -z "$ac_ct_curses_hdr"],
[AC_MSG_ERROR([could not find curses header, required for the kconfig frontends])])
AC_SEARCH_LIBS(
[initscr],
[ncursesw ncurses curses],
[ac_ct_curses_lib_found=yes; break])
AS_IF(
[test -z "$ac_ct_curses_lib_found"],
[AC_MSG_ERROR([could not find curses library, required for the kconfig frontends])])
#--------------------------------------------------------------------
# Lastly, take care of crosstool-NG internal values
#--------------------------------------------------------------------
# Hey! We need the date! :-)
AC_SUBST(
[DATE],
[$(date +%Y%m%d)])
# Decorate the version string if needed
AS_IF(
[test -f version.sh -a -x version.sh],
[V=$(./version.sh "${PACKAGE_VERSION}")])
AS_IF(
[test -n "${V}"],
[PACKAGE_VERSION="${V}"],
[AS_CASE(
[${PACKAGE_VERSION}],
[hg|*+hg],
[rev_id="$( hg log -r . --template '{branch}-{node|short}\n' \
2>/dev/null \
|| true )"
PACKAGE_VERSION="${PACKAGE_VERSION}+${rev_id:-unknown-$( date +%Y%m%d.%H%M%S )}"
])])
# Arrange to have no / in the directory name, no need to create an
# arbitrarily deep directory structure
[PACKAGE_VERSION="$( printf "${PACKAGE_VERSION}\n" |"${SED}" -r -e 's:/+:_:g;' )"]
# Handle the local case
AC_SUBST([sublibdir])
AC_SUBST([subdocdir])
AS_IF(
[test "x$enable_local" = "xyes"],
[AC_MSG_NOTICE([overiding all of --prefix and the likes, because --enable-local was set])
prefix=$(pwd)
exec_prefix="$prefix"
bindir="$prefix"
libdir="$prefix"
sublibdir=""
docdir="$prefix""/docs"
subdocdir=""
datarootdir="$prefix"
mandir="$docdir"],
[sublibdir="/ct-ng.\${VERSION}"
subdocdir="/ct-ng.\${VERSION}"])
#--------------------------------------------------------------------
# Finally, generate the output file(s)
#--------------------------------------------------------------------
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

View File

@ -0,0 +1,79 @@
# Helper makefile which downloads (if required) and runs the GCC test suite (DejaGnu)
#
# Note: Before run please make sure to have your toolchain available in your path.
#
# Copyright 2010 DoréDevelopment
#
# Author: Martin Lund <mgl@doredevelopment.dk>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# Internal configuration
TARGET:=@@DG_TARGET@@
TOPDIR:=$(shell pwd)
LOGDIR:=$(TOPDIR)/tmp
# Include default configuration
include default.cfg
# Add toolchain to path
PATH:=$(shell cd ../../bin && pwd):$(PATH)
# Select test set
ifeq ($(DG_TOOLNAME),gcc)
DG_TESTS:=$(DG_C_TESTS)
endif
ifeq ($(DG_TOOLNAME),g++)
DG_TESTS:=$(DG_CPP_TESTS)
endif
# Check that we have 'runtest' installed
RUNTEST=$(shell which runtest)
ifeq ($(RUNTEST),)
$(error "DejaGnu 'runtest' not found - please install (eg. apt-get install dejagnu)")
endif
# Targets
all: test
$(LOGDIR):
@mkdir -p $@
$(LOGDIR)/site.exp: $(TOPDIR)/default.cfg $(LOGDIR)
@{ echo 'lappend boards_dir "$(LOGDIR)"'; \
echo 'set target_alias $(TARGET)'; } > $@
$(LOGDIR)/board.exp: $(TOPDIR)/default.cfg $(LOGDIR)
@{ echo 'load_generic_config "unix"'; \
echo 'process_multilib_options ""'; \
echo 'set_board_info bmk,use_alarm 1'; \
echo 'set_board_info rsh_prog ssh'; \
echo 'set_board_info rcp_prog scp'; \
echo 'set_board_info hostname $(DG_TARGET_HOSTNAME)'; \
echo 'set_board_info username $(DG_TARGET_USERNAME)'; } > $@
# As Martin puts it:
# > The thing is that when you run 50k+ test cases the odds are that at
# > least one will fail and thus runtest basically always return an error
# > despite the fact that the test session has executed successfully.
# So just ignore any error reported by runtest
test: $(LOGDIR)/board.exp $(LOGDIR)/site.exp $(LOGDIR)
@runtest --tool $(DG_TOOLNAME) \
--srcdir $(TOPDIR)/testsuite \
--objdir $(LOGDIR) \
--outdir $(LOGDIR) \
--all \
--target $(TARGET) \
--target_board board \
$(DG_TESTS) \
GXX_UNDER_TEST=$(TARGET)-g++ || true
@printf "Result files available in '%s'\n" "$(LOGDIR)"
clean:
rm -rf $(LOGDIR)
.PHONY: config test clean

View File

@ -0,0 +1,83 @@
Helper Makefile for testing gcc toolchains using the gcc-testsuite
==================================================================
Requirements
------------
* DejaGnu 'runtest' v1.4.4+
* Make v3.81+
Configuration
-------------
Edit default.cfg to reflect your toolchain and target configuration.
Alternatively, override configuration variables on the command line.
Available config variables:
DG_TOOLNAME
The name of the tool you want to test.
Currently supported: gcc or g++
Default: gcc
DG_TARGET_HOSTNAME
The hostname or IP of the machine to execute run-tests
Default: 127.0.0.1
DG_TARGET_USERNAME
Execute the run-test as this user on DG_TARGET_HOSTNAME
Default: root
DG_C_TESTS
DG_CPP_TESTS
The C/C++ tests you want to check
Default: (empty, means all tests)
Run examples
------------
The first two examples require a networked target with ssh access and automatic
ssh login (see section below). Target SW should be compiled with the toolchain
to be tested.
Run default gcc compile/execution tests:
$ make DG_TOOLNAME=gcc DG_TARGET_HOSTNAME=192.168.17.93 DG_TARGET_USERNAME=root
Run default g++ compile/execution tests:
$ make DG_TOOLNAME=g++ DG_TARGET_HOSTNAME=192.168.17.93 DG_TARGET_USERNAME=root
Run selected gcc compile only tests (no target required):
$ make DG_TOOLNAME=gcc DG_C_TESTS="compile.exp noncompile.exp"
SSH automatic login configuration example
-----------------------------------------
On host do:
ssh-keygen -t rsa (then simply press enter thru all steps)
ssh-copy-id -i ~/.ssh/id_rsa.pub <username>@<target IP>
Now automatic ssh login should work - test by doing a simple ssh session to target.
Note: The procedure might be slightly different for your particular target.
Getting rid of the test-suite
-----------------------------
If you no longer have a need for the test-suite, then you can remove it altogether
from your toolchain. Just delete the test-suite/ dub-dir.
Author
------
Martin Lund <mgl@doredevelopment.dk>
Initial content
"Yann E. MORIN" <yann.morin.1998@free.fr>
Getting rid of the test-suite
Minor fixes

View File

@ -0,0 +1,10 @@
# Default test suite configuration
# Default DejaGnu configuration
DG_TOOLNAME = gcc
DG_TARGET_HOSTNAME = 127.0.0.1
DG_TARGET_USERNAME = root
# Default tests
DG_C_TESTS =
DG_CPP_TESTS =

Binary file not shown.

36
crosstool-ng/ct-ng.comp Normal file
View File

@ -0,0 +1,36 @@
# To be sourced
_ct_ng () {
local cur prev samples show_samples actions steps start_steps stop_steps ct_ng_opts vars
COMPREPLY=()
cur=$(_get_cword)
prev=${COMP_WORDS[COMP_CWORD-1]}
samples=$( "${COMP_WORDS[0]}" list-samples-short 2>/dev/null )
show_samples=$(echo "${samples}" |sed -r -e 's/(^| )/\1show-/g;')
build_samples=$(echo "${samples}" |sed -r -e 's/(^| )/\1build-/g;')
check_samples=$(echo "${samples}" |sed -r -e 's/(^| )/\1check-/g;')
steps=$(${COMP_WORDS[0]} list-steps 2>/dev/null |awk '$1 == "-" { print $2; }')
start_steps=$(echo "${steps}" |sed -r -e 's/($| )/\1+/;')
stop_steps=$(echo "${steps}" |sed -r -e 's/(^| )/+\1/;')
actions='help menuconfig oldconfig saveconfig extractconfig
defconfig savedefconfig
build build. build-all build-all.
wiki-samples list-samples list-samples-short check-samples
list-steps
show-tuple show-all show-config
clean distclean updatetools
tarball version'
vars="RESTART= STOP= PREFIX= V= DEFCONFIG="
ct_ng_opts="${samples} ${show_samples} ${build_samples} ${check_samples}
${steps} ${start_steps} ${stop_steps}
${actions} ${vars}"
COMPREPLY=($(compgen -W "${ct_ng_opts}" -- "${cur}"))
return 0
}
complete -F _ct_ng ct-ng

182
crosstool-ng/ct-ng.in Normal file
View File

@ -0,0 +1,182 @@
#!@@CT_make@@ -rf
# Makefile for crosstool-NG.
# Copyright 2006 Yann E. MORIN <yann.morin.1998@free.fr>
# Don't print directory as we descend into them
# Don't use built-in rules, we know what we're doing
MAKEFLAGS += --no-print-directory --no-builtin-rules
# Don't go parallel
.NOTPARALLEL:
# This is where ct-ng is:
export CT_NG:=$(lastword $(MAKEFILE_LIST))
# and this is where we're working in:
export CT_TOP_DIR:=$(shell pwd)
# Paths and values set by ./configure
# Don't bother to change it other than with a new ./configure!
export CT_LIB_DIR:=@@CT_LIBDIR@@
export CT_DOC_DIR:=@@CT_DOCDIR@@
# This is crosstool-NG version string
export CT_VERSION:=@@CT_VERSION@@
# Paths found by ./configure
include $(CT_LIB_DIR)/paths.mk
# Some distributions (eg. Ubuntu) thought it wise to point /bin/sh to
# a truly POSIX-conforming shell, ash in this case. This is not so good
# as we, smart (haha!) developers (as smart we ourselves think we are),
# got used to bashisms, and are enclined to easiness... So force use of
# bash.
export SHELL=$(bash)
# GREP_OPTIONS=--color=always will break the generated .in files
# We do not need any GREP_OPTIONS anyway, so set it to empty.
export GREP_OPTIONS=
# Make the restart/stop steps availabe to scripts/crostool-NG.sh
export CT_STOP:=$(STOP)
export CT_RESTART:=$(RESTART)
SILENT=@
ECHO=echo
ifeq ($(strip $(origin V)),command line)
ifeq ($(strip $(V)),0)
SILENT=@
ECHO=:
else
ifeq ($(strip $(V)),1)
SILENT=
ECHO=:
else
ifeq ($(strip $(V)),2)
SILENT=
ECHO=echo
endif # V == 2
endif # V== 1
endif # V == 0
endif # origin V
export V SILENT ECHO
all: help
.PHONY: $(PHONY)
PHONY += all
FORCE:
# Help system
help:: help-head help-config help-samples help-build help-clean help-distrib help-env help-tail
help-head:: version
@echo 'See below for a list of available actions, listed by category:'
help-config::
@echo
@echo 'Configuration actions:'
help-samples::
@echo
@echo 'Preconfigured toolchains (#: force number of // jobs):'
help-build::
@echo
@echo 'Build actions (#: force number of // jobs):'
help-clean::
@echo
@echo 'Clean actions:'
help-distrib::
@echo
@echo 'Distribution actions:'
help-env::
@echo
@echo 'Environment variables (see @@CT_DOCDIR@@/0 - Table of content.txt):'
help-tail::
@echo
@echo 'Use action "menuconfig" to configure your toolchain'
@echo 'Use action "build" to build your toolchain'
@echo 'Use action "version" to see the version'
@echo 'See "man 1 $(notdir $(CT_NG))" for some help as well'
help-build::
@echo ' build[.#] - Build the currently configured toolchain'
help-clean::
@echo ' clean - Remove generated files'
@echo ' distclean - Remove generated files, configuration and build directories'
include $(CT_LIB_DIR)/config/config.mk
include $(CT_LIB_DIR)/kconfig/kconfig.mk
include $(CT_LIB_DIR)/steps.mk
include $(CT_LIB_DIR)/samples/samples.mk
include $(CT_LIB_DIR)/scripts/scripts.mk
help-config::
@echo ' show-tuple - Print the tuple of the currently configured toolchain'
help-distrib::
@echo ' tarball - Build a tarball of the configured toolchain'
help-env::
@echo ' V=0|1|2 - 0 => show only human-readable messages (default)'
@echo ' 1 => show only the commands being executed'
@echo ' 2 => show both'
# End help system
.config:
@echo "There is no existing .config file!"
@echo "You need to either run 'menuconfig',"
@echo "or configure an existing sample."
@false
.config.2: .config
$(SILENT)$(sed) -r -e 's/^([^=]+_ARRAY)="(.*)"$$/\1=( \2 )/;' \
-e '/^[^=]+_ARRAY=/s/\\(.)/\1/g;' \
$< >$@
show-tuple: .config.2
$(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showTuple.sh
# Actual build
build: .config.2
$(SILENT)$(CT_LIB_DIR)/scripts/crosstool-NG.sh
build.%:
$(SILENT)$(MAKE) -rf $(CT_NG) $(shell echo "$(@)" |$(sed) -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;')
PHONY += tarball
#tarball:
# @$(CT_LIB_DIR)/scripts/tarball.sh
tarball:
@echo 'Tarball creation disabled for now... Sorry.'
@true
PHONY += version
version:
@echo 'This is crosstool-NG version $(CT_VERSION)'
@echo
@echo 'Copyright (C) 2008 Yann E. MORIN <yann.morin.1998@free.fr>'
@echo 'This is free software; see the source for copying conditions.'
@echo 'There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A'
@echo 'PARTICULAR PURPOSE.'
@echo
PHONY += clean
clean::
@$(ECHO) " CLEAN log"
$(SILENT)rm -f build.log .config.* ..config*
PHONY += distclean
distclean:: clean
@$(ECHO) " CLEAN .config"
$(SILENT)rm -f .config .config.* ..config*
@$(ECHO) " CLEAN build dir"
$(SILENT)[ ! -d targets ] || chmod -R u+w targets
$(SILENT)[ ! -d .build ] || chmod -R u+w .build
$(SILENT)rm -rf targets .build

View File

@ -0,0 +1,72 @@
File.........: 0 - Table of content.txt
Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@free.fr>
License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
Table Of Content /
_________________/
1- Introduction
- History
- Referring to crosstool-NG
2- Installing crosstool-NG
- Install method
- The hacker's way
- Preparing for packaging
- Shell completion
- Contributed code
3- Configuring a toolchain
- Interesting config options
- Re-building an existing toolchain
- Using as a backend for a build-system
4- Building the toolchain
- Stopping and restarting a build
- Testing all toolchains at once
- Overriding the number of // jobs
- Note on // jobs
- Tools wrapper
5- Using the toolchain
- The 'populate' script
6- Toolchain types
- Seemingly-native toolchains
7- Contributing
- Sending a bug report
- Sending patches
8- Internals
- Makefile front-end
- Kconfig parser
- Architecture-specific
- Adding a new version of a component
- Build scripts
9 - How is a toolchain constructed?
- I want a cross-compiler! What is this toolchain you're speaking about?
- So, what are those components in a toolchain?
- And now, how do all these components chained together?
- So the list is complete. But why does crosstool-NG have more steps?
A- Credits
B- Known issues
- gcc is not found, although I *do* have gcc installed
- The extract and/or path steps fail under Cygwin
- uClibc fails to build under Cygwin
- On 64-bit build systems, the glibc (possibly eglibc too) build
fails for 64-bit targets, because it can not find libgcc
- libtool.m4: error: problem compiling FC test program
- unable to detect the exception model
- configure: error: forced unwind support is required
- glibc start files and headers fail with: [/usr/include/limits.h] Error 1
C- Misc. tutorials
- Using crosstool-NG on FreeBSD (and other *BSD)
- Using crosstool-NG on MacOS-X
- Using Mercurial to hack crosstool-NG

View File

@ -0,0 +1,108 @@
File.........: 1 - Introduction.txt
Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@free.fr>
License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
Introduction /
_____________/
crosstool-NG aims at building toolchains. Toolchains are an essential component
in a software development project. It will compile, assemble and link the code
that is being developed. Some pieces of the toolchain will eventually end up
in the resulting binary/ies: static libraries are but an example.
So, a toolchain is a very sensitive piece of software, as any bug in one of the
components, or a poorly configured component, can lead to execution problems,
ranging from poor performance, to applications ending unexpectedly, to
mis-behaving software (which more than often is hard to detect), to hardware
damage, or even to human risks (which is more than regrettable).
Toolchains are made of different piece of software, each being quite complex
and requiring specially crafted options to build and work seamlessly. This
is usually not that easy, even in the not-so-trivial case of native toolchains.
The work reaches a higher degree of complexity when it comes to cross-
compilation, where it can become quite a nightmare...
Some cross-toolchains exist on the internet, and can be used for general
development, but they have a number of limitations:
- they can be general purpose, in that they are configured for the majority:
no optimisation for your specific target,
- they can be prepared for a specific target and thus are not easy to use,
nor optimised for, or even supporting your target,
- they often are using aging components (compiler, C library, etc...) not
supporting special features of your shiny new processor;
On the other side, these toolchain offer some advantages:
- they are ready to use and quite easy to install and setup,
- they are proven if used by a wide community.
But once you want to get all the juice out of your specific hardware, you will
want to build your own toolchain. This is where crosstool-NG comes into play.
There are also a number of tools that build toolchains for specific needs,
which are not really scalable. Examples are:
- buildroot (buildroot.uclibc.org) whose main purpose is to build root file
systems, hence the name. But once you have your toolchain with buildroot,
part of it is installed in the root-to-be, so if you want to build a whole
new root, you either have to save the existing one as a template and
restore it later, or restart again from scratch. This is not convenient,
- ptxdist (www.pengutronix.de/software/ptxdist), whose purpose is very
similar to buildroot,
- other projects (openembedded.org for example), which are again used to
build root file systems.
crosstool-NG is really targeted at building toolchains, and only toolchains.
It is then up to you to use it the way you want.
History |
--------+
crosstool was first 'conceived' by Dan Kegel, who offered it to the community
as a set of scripts, a repository of patches, and some pre-configured, general
purpose setup files to be used to configure crosstool. This is available at
http://www.kegel.com/crosstool, and the subversion repository is hosted on
google at http://code.google.com/p/crosstool/.
I once managed to add support for uClibc-based toolchains, but it did not make
into mainline, mostly because I didn't have time to port the patch forward to
the new versions, due in part to the big effort it was taking.
So I decided to clean up crosstool in the state it was, re-order the things
in place, add appropriate support for what I needed, that is uClibc support
and a menu-driven configuration, named the new implementation crosstool-NG,
(standing for crosstool Next Generation, as many other community projects do,
and as a wink at the TV series "Star Trek: The Next Generation" ;-) ) and
made it available to the community, in case it was of interest to any one.
Referring to crosstool-NG |
--------------------------+
The long name of the project is crosstool-NG:
* no leading uppercase (except as first word in a sentence)
* crosstool and NG separated with a hyphen (dash)
* NG in uppercase
Crosstool-NG can also be referred to by its short name CT-NG:
* all in uppercase
* CT and NG separated with a hyphen (dash)
The long name is preferred over the short name, except in mail subjects, where
the short name is a better fit.
When referring to a specific version of crosstool-NG, append the version number
either as:
* crosstool-NG X.Y.Z
- the long name, a space, and the version string
* crosstool-ng-X.Y.Z
- the long name in lowercase, a hyphen (dash), and the version string
- this is used to name the release tarballs
* crosstool-ng-X.Y.Z+hg_id
- the long name in lowercase, a hyphen, the version string, and the Hg id
(as returned by: ct-ng version)
- this is used to differentiate between releases and snapshots
The frontend to crosstool-NG is the command ct-ng:
* all in lowercase
* ct and ng separated by a hyphen (dash)

View File

@ -0,0 +1,99 @@
File.........: 2 - Installing crosstool-NG.txt
Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@free.fr>
License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
Installing crosstool-NG /
________________________/
There are two ways you can use crosstool-NG:
- build and install it, then get rid of the sources like you'd do for most
programs,
- or only build it and run from the source directory.
The former should be used if you got crosstool-NG from a packaged tarball, see
"Install method", below, while the latter is most useful for developers that
use a clone of the repository, and want to submit patches, see "The Hacker's
way", below.
Install method |
---------------+
If you go for the install, then you just follow the classical, but yet easy
./configure way:
./configure --prefix=/some/place
make
make install
export PATH="${PATH}:/some/place/bin"
You can then get rid of crosstool-NG source. Next create a directory to serve
as a working place, cd in there and run:
mkdir work-dir
cd work-dir
ct-ng help
See below for complete usage.
The Hacker's way |
-----------------+
If you go the hacker's way, then the usage is a bit different, although very
simple. First, you need to generate the ./configure script from its autoconf
template:
./bootstrap
Then, you run ./configure for local execution of crosstool-NG:
./configure --enable-local
make
Now, *do not* remove crosstool-NG sources. They are needed to run crosstool-NG!
Stay in the directory holding the sources, and run:
./ct-ng help
See below for complete usage.
Now, provided you used a clone of the repository, you can send me your changes.
See the section titled CONTRIBUTING, below, for how to submit changes.
Preparing for packaging |
------------------------+
If you plan on packaging crosstool-NG, you surely don't want to install it
in your root file system. The install procedure of crosstool-NG honors the
DESTDIR variable:
./configure --prefix=/usr
make
make DESTDIR=/packaging/place install
Shell completion |
-----------------+
crosstool-NG comes with a shell script fragment that defines bash-compatible
completion. That shell fragment is currently not installed automatically, but
this is planned.
To install the shell script fragment, you have two options:
- install system-wide, most probably by copying ct-ng.comp into
/etc/bash_completion.d/
- install for a single user, by copying ct-ng.comp into ${HOME}/ and
sourcing this file from your ${HOME}/.bashrc
Contributed code |
-----------------+
Some people contributed code that couldn't get merged for various reasons. This
code is available as lzma-compressed patches, in the contrib/ sub-directory.
These patches are to be applied to the source of crosstool-NG, prior to
installing, using something like the following:
lzcat contrib/foobar.patch.lzma |patch -p1
There is no guarantee that a particular contribution applies to the current
version of crosstool-ng, or that it will work at all. Use contributions at
your own risk.

View File

@ -0,0 +1,133 @@
File.........: 3 - Configuring a toolchain.txt
Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@free.fr>
License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
Configuring crosstool-NG /
_________________________/
crosstool-NG is configured with a configurator presenting a menu-structured set
of options. These options let you specify the way you want your toolchain
built, where you want it installed, what architecture and specific processor it
will support, the version of the components you want to use, etc... The
value for those options are then stored in a configuration file.
The configurator works the same way you configure your Linux kernel. It is
assumed you now how to handle this.
To enter the menu, type:
ct-ng menuconfig
Almost every config item has a help entry. Read them carefully.
String and number options can refer to environment variables. In such a case,
you must use the shell syntax: ${VAR}. You shall neither single- nor double-
quote the string/number options.
There are three environment variables that are computed by crosstool-NG, and
that you can use:
CT_TARGET:
It represents the target tuple you are building for. You can use it for
example in the installation/prefix directory, such as:
/opt/x-tools/${CT_TARGET}
CT_TOP_DIR:
The top directory where crosstool-NG is running. You shouldn't need it in
most cases. There is one case where you may need it: if you have local
patches and you store them in your running directory, you can refer to them
by using CT_TOP_DIR, such as:
${CT_TOP_DIR}/patches.myproject
CT_VERSION:
The version of crosstool-NG you are using. Not much use for you, but it's
there if you need it.
Interesting config options |
---------------------------+
CT_LOCAL_TARBALLS_DIR:
If you already have some tarballs in a directory, enter it here. That will
speed up the retrieving phase, where crosstool-NG would otherwise download
those tarballs.
CT_PREFIX_DIR:
This is where the toolchain will be installed in (and for now, where it
will run from). Common use is to add the target tuple in the directory
path, such as (see above):
/opt/x-tools/${CT_TARGET}
CT_TARGET_VENDOR:
An identifier for your toolchain, will take place in the vendor part of the
target tuple. It shall *not* contain spaces or dashes. Usually, keep it
to a one-word string, or use underscores to separate words if you need.
Avoid dots, commas, and special characters.
CT_TARGET_ALIAS:
An alias for the toolchain. It will be used as a prefix to the toolchain
tools. For example, you will have ${CT_TARGET_ALIAS}-gcc
Also, if you think you don't see enough versions, you can try to enable one of
those:
CT_OBSOLETE:
Show obsolete versions or tools. Most of the time, you don't want to base
your toolchain on too old a version (of gcc, for example). But at times, it
can come handy to use such an old version for regression tests. Those old
versions are hidden behind CT_OBSOLETE. Those versions (or features) are so
marked because maintaining support for those in crosstool-NG would be too
costly, time-wise, and time is dear.
CT_EXPERIMENTAL:
Show experimental versions or tools. Again, you might not want to base your
toolchain on too recent tools (eg. gcc) for production. But if you need a
feature present only in a recent version, or a new tool, you can find them
hidden behind CT_EXPERIMENTAL. Those versions (or features) did not (yet)
receive thorough testing in crosstool-NG, and/or are not mature enough to
be blindly trusted.
Re-building an existing toolchain |
----------------------------------+
If you have an existing toolchain, you can re-use the options used to build it
to create a new toolchain. That needs a very little bit of effort on your side
but is quite easy. The options to build a toolchain are saved with the
toolchain, and you can retrieve this configuration by running:
${CT_TARGET}-ct-ng.config
An alternate method is to extract the configuration from a build.log file.
This will be necessary if your toolchain was build with crosstool-NG prior
to 1.4.0, but can be used with build.log files from any version:
ct-ng extractconfig <build.log >.config
Or, if your build.log file is compressed (most probably!):
bzcat build.log.bz2 |ct-ng extractconfig >.config
The above commands will dump the configuration to stdout, so to rebuild a
toolchain with this configuration, just redirect the output to the
.config file:
${CT_TARGET}-ct-ng.config >.config
ct-ng oldconfig
Then, you can review and change the configuration by running:
ct-ng menuconfig
Using as a backend for a build-system |
--------------------------------------+
Crosstool-NG can be used as a backend for an automated build-system. In this
case, some components that are expected to run on the target (eg. the native
gdb, ltrace, DUMA...) are not available in the menuconfig, and they are not
build either, as it is considered the responsibility of the build-system to
build its own versions of those tools.
If you want to use crosstool-NG as a backend to generate your toolchains for
your build-system, you have to set and export this environment variable:
CT_IS_A_BACKEND=y
(case is not sensitive, you can say Y).

View File

@ -0,0 +1,142 @@
File.........: 4 - Building the toolchain.txt
Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@free.fr>
License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
Building the toolchain /
_______________________/
To build the toolchain, simply type:
ct-ng build
This will use the above configuration to retrieve, extract and patch the
components, build, install and eventually test your newly built toolchain.
You are then free to add the toolchain /bin directory in your PATH to use
it at will.
In any case, you can get some terse help. Just type:
ct-ng help
or:
man 1 ct-ng
Stopping and restarting a build |
--------------------------------+
If you want to stop the build after a step you are debugging, you can pass the
variable STOP to make:
ct-ng build STOP=some_step
Conversely, if you want to restart a build at a specific step you are
debugging, you can pass the RESTART variable to make:
ct-ng build RESTART=some_step
Alternatively, you can call make with the name of a step to just do that step:
ct-ng libc_headers
is equivalent to:
ct-ng build RESTART=libc_headers STOP=libc_headers
The shortcuts +step_name and step_name+ allow to respectively stop or restart
at that step. Thus:
ct-ng +libc_headers and: ct-ng libc_headers+
are equivalent to:
ct-ng build STOP=libc_headers and: ct-ng build RESTART=libc_headers
To obtain the list of acceptable steps, please call:
ct-ng list-steps
Note that in order to restart a build, you'll have to say 'Y' to the config
option CT_DEBUG_CT_SAVE_STEPS, and that the previous build effectively went
that far.
Building all toolchains at once |
--------------------------------+
You can build all samples; simply call:
ct-ng build-all
Overriding the number of // jobs |
---------------------------------+
If you want to override the number of jobs to run in // (the -j option to
make), you can either re-enter the menuconfig, or simply add it on the command
line, as such:
ct-ng build.4
which tells crosstool-NG to override the number of // jobs to 4.
You can see the actions that support overriding the number of // jobs in
the help menu. Those are the ones with [.#] after them (eg. build[.#] or
build-all[.#], and so on...).
Note on // jobs |
----------------+
The crosstool-NG script 'ct-ng' is a Makefile-script. It does *not* execute
in parallel (there is not much to gain). When speaking of // jobs, we are
refering to the number of // jobs when making the *components*. That is, we
speak of the number of // jobs used to build gcc, glibc, and so on...
Tools wrapper |
--------------+
Starting with gcc-4.3 come two new dependencies: GMP and MPFR. With gcc-4.4,
come three new ones: PPL, CLooG/ppl and MPC. With gcc-4.5 again comes a new
dependency on libelf. These are libraries that enable advanced features to
gcc. Additionally, some of those libraries can be used by binutils and gdb.
Unfortunately, not all systems on which crosstool-NG runs have all of those
libraries. And for those that do, the versions of those libraries may be
older than the version required by gcc (and binutils and gdb). To date,
Debian stable (aka Lenny) is lagging behind on some, and is missing the
others.
This is why crosstool-NG builds its own set of libraries as part of the
toolchain.
The companion libraries can be built either as static libraries, or as shared
libraries. The default is to build static libraries, and is the safe way.
If you decide to use static companion libraries, then you can stop reading
this section.
But if you prefer to have shared libraries, then read on...
Building shared companion libraries poses no problem at build time, as
crosstool-NG correctly points gcc (and binutils and gdb) to the correct
place where our own version of the libraries are installed. But it poses
a problem when gcc et al. are run: the place where the libraries are is most
probably not known to the host dynamic linker. Still worse, if the host system
has its own versions, then ld.so would load the wrong libraries!
So we have to force the dynamic linker to load the correct version. We do this
by using the LD_LIBRARY_PATH variable, that informs the dynamic linker where
to look for shared libraries prior to searching its standard places. But we
can't impose that burden on all the system (because it'd be a nightmare to
configure, and because two toolchains on the same system may use different
versions of the libraries); so we have to do it on a per-toolchain basis.
So we rename all binaries of the toolchain (by adding a dot '.' as their first
character), and add a small program, the so-called "tools wrapper", that
correctly sets LD_LIBRARY_PATH prior to running the real tool.
First, the wrapper was written as a POSIX-compliant shell script. That shell
script is very simple, if not trivial, and works great. The only drawback is
that it does not work on host systems that lack a shell, for example the
MingW32 environment. To solve the issue, the wrapper has been re-written in C,
and compiled at build time. This C wrapper is much more complex than the shell
script, and although it seems to be working, it's been only lightly tested.
Some of the expected short-comings with this C wrapper are;
- multi-byte file names may not be handled correctly
- it's really big for what it does
So, the default wrapper installed with your toolchain is the shell script.
If you know that your system is missing a shell, then you shall use the C
wrapper (and report back whether it works, or does not work, for you).
A final word on the subject: do not build shared libraries. Build them
static, and you'll be safe.

View File

@ -0,0 +1,231 @@
File.........: 5 - Using the toolchain.txt
Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@free.fr>
License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
Using the toolchain /
____________________/
Using the toolchain is as simple as adding the toolchain's bin directory in
your PATH, such as:
export PATH="${PATH}:/your/toolchain/path/bin"
and then using the '--host' tuple to tell the build systems to use your
toolchain (if the software package uses the autotools system you should
also pass --build, for completeness):
./configure --host=your-host-tuple --build=your-build-tuple
or
make CC=your-host-tuple-gcc
or
make CROSS_COMPILE=your-host-tuple-
and so on...
(Note: in the above example, 'host' refers to the host of your program,
not the host of the toolchain; and 'build' refers to the machine where
you build your program, that is the host of the toolchain.)
Assembling a root filesystem /
_____________________________/
Assembling a root filesystem for a target device requires the successive
building of a set of software packages for the target architecture. Building
a package potentially requires artifacts which were generated as part of an
earlier build. Note that not all artifacts which are installed as part of a
package are desirable on a target's root filesystem (e.g. man/info files,
include files, etc.). Therefore we must distinguish between a 'staging'
directory and a 'rootfs' directory.
A 'staging' directory is a location into which we install all the build
artifacts. We can then point future builds to this location so they can find
the appropriate header and library files. A 'rootfs' directory is a location
into which we place only the files we want to have on our target.
There are four schools of thought here:
1) Install directly into the sysroot of the toolchain.
By default (i.e. if you don't pass any arguments to the tools which
would change this behaviour) the toolchain that is built by
crosstool-NG will only look in its toolchain directories for system
header and library files:
#include "..." search starts here:
#include <...> search starts here:
<ct-ng install path>/lib/gcc/<host tuple>/4.5.2/include
<ct-ng install path>/lib/gcc/<host tuple>/4.5.2/include-fixed
<ct-ng install path>/lib/gcc/<host tuple>/4.5.2/../../../../<host tuple>/include
<ct-ng install path>/<host tuple>/sysroot/usr/include
In other words, the compiler will automagically find headers and
libraries without extra flags if they are installed under the
toolchain's sysroot directory.
However, this is bad because the toolchain gets poluted, and can
not be re-used.
$ ./configure --build=<build tuple> --host=<host tuple> \
--prefix=/usr --enable-foo-bar...
$ make
$ make DESTDIR=/<ct-ng install path>/<host tuple>/sysroot install
2) Copy the toolchain's sysroot to the 'staging' area.
If you start off by copying the toolchain's sysroot directory to your
staging area, you can simply proceed to install all your packages'
artifacts to the same staging area. You then only need to specify a
'--sysroot=<staging area>' option to the compiler of any subsequent
builds and all your required header and library files will be found/used.
This is a viable option, but requires the user to always specify CFLAGS
in order to include --sysroot=<staging area>, or requires the use of a
wrapper to a few select tools (gcc, ld...) to pass this flag.
Instead of polluting the toolchain's sysroot you are copying its contents
to a new location and polluting the contents in that new location. By
specifying the --sysroot option you're effectively abandoning the default
sysroot in favour of your own.
Incidentally this is what buildroot does using a wrapper, when using an
external toolchain.
$ cp -a $(<host tuple>-gcc --your-cflags-except-sysroot -print-sysroot) \
/path/to/staging
$ ./configure --build=<build tuple> --host=<host tuple> \
--prefix=/usr --enable-foo-bar... \
CC="<host tuple>-gcc --syroot=/path/to/staging" \
CXX="<host tuple>-g++ --sysroot=/path/to/staging" \
LD="<host tuple>-ld --sysroot=/path/to/staging" \
AND_SO_ON="tuple-andsoon --sysroot=/path/to/staging"
$ make
$ make DESTDIR=/path/to/staging install
3) Use separate staging and sysroot directories.
In this scenario you use a staging area to install programs, but you do
not pre-fill that staging area with the toolchain's sysroot. In this case
the compiler will find the system includes and libraries in its sysroot
area but you have to pass appropriate CPPFLAGS and LDFLAGS to tell it
where to find your headers and libraries from your staging area (or use
a wrapper).
$ ./configure --build=<build tuple> --host=<host tuple> \
--prefix=/usr --enable-foo-bar... \
CPPFLAGS="-I/path/to/staging/usr/include" \
LDFLAGS="-L/path/to/staging/lib -L/path/to/staging/usr/lib"
$ make
$ make DESTDIR=/path/to/staging install
4) A mix of 2) and 3), using carefully crafted union mounts.
The staging area is a union mount of:
- the sysroot as a read-only branch
- the real staging area as a read-write branch
This also requires passing --sysroot to point to the union mount, but has
other advantages, such as allowing per-package staging, and a few more
obscure pros. It also has its disadvantages, as it potentially requires
non-root users to create union mounts. Additionally, union mounts are not
yet mainstream in the Linux kernel, so it requires patching. There is a
FUSE-based unionfs implementation, but development is almost stalled,
and there are a few gotchas...
$ (good luck!)
It is strongly advised not to use the toolchain sysroot directory as an
install directory (i.e. option 1) for your programs/packages. If you do so,
you will not be able to use your toolchain for another project. It is even
strongly advised that your toolchain is chmod-ed to read-only once
successfully install, so that you don't go polluting your toolchain with
your programs'/packages' files. This can be achieved by selecting the
"Render the toolchain read-only" from crosstool-NG's "Paths and misc options"
configuration page.
Thus, when you build a program/package, install it in a separate, staging,
directory and let the cross-toolchain continue to use its own, pristine,
sysroot directory.
When you are done building and want to assemble your rootfs you could simply
take the full contents of your staging directory and use the 'populate'
script to add in the necessary files from the sysroot. However, the staging
area you have created will include lots of build artifacts that you won't
necessarily want/need on your target. For example: static libraries, header
files, linking helper files, man/info pages. You'll also need to add various
configuration files, scripts, and directories to the rootfs so it will boot.
Therefore you'll probably end up creating a separate rootfs directory which
you will populate from the staging area, necessary extras, and then use
crosstool-NG's populate script to add the necessary sysroot libraries.
The 'populate' script |
----------------------+
When your root directory is ready, it is still missing some important bits: the
toolchain's libraries. To populate your root directory with those libs, just
run:
your-target-tuple-populate -s /your/root -d /your/root-populated
This will copy /your/root into /your/root-populated, and put the needed and only
the needed libraries there. Thus you don't pollute /your/root with any cruft that
would no longer be needed should you have to remove stuff. /your/root always
contains only those things you install in it.
You can then use /your/root-populated to build up your file system image, a
tarball, or to NFS-mount it from your target, or whatever you need.
The populate script accepts the following options:
-s src_dir
Use 'src_dir' as the un-populated root directory.
-d dst_dir
Put the populated root directory in 'dst_dir'.
-l lib1 [...]
Always add specified libraries.
-L file
Always add libraries listed in 'file'.
-f
Remove 'dst_dir' if it previously existed; continue even if any library
specified with -l or -L is missing.
-v
Be verbose, and tell what's going on (you can see exactly where libs are
coming from).
-h
Print the help.
See 'your-target-tuple-populate -h' for more information on the options.
Here is how populate works:
1) performs some sanity checks:
- src_dir and dst_dir are specified
- src_dir exists
- unless forced, dst_dir does not exist
- src_dir != dst_dir
2) copy src_dir to dst_dir
3) add forced libraries to dst_dir
- build the list from -l and -L options
- get forced libraries from the sysroot (see below for heuristics)
- abort on the first missing library, unless -f is specified
4) add all missing libraries to dst_dir
- scan dst_dir for every ELF files that are 'executable' or
'shared object'
- list the "NEEDED Shared library" fields
- check if the library is already in dst_dir/lib or dst_dir/usr/lib
- if not, get the library from the sysroot
- if it's in sysroot/lib, copy it to dst_dir/lib
- if it's in sysroot/usr/lib, copy it to dst_dir/usr/lib
- in both cases, use the SONAME of the library to create the file
in dst_dir
- if it was not found in the sysroot, this is an error.

View File

@ -0,0 +1,64 @@
File.........: 6 - Toolchain types.txt
Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@free.fr>
License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
Toolchain types /
________________/
There are four kinds of toolchains you could encounter.
First off, you must understand the following: when it comes to compilers there
are up to four machines involved:
1) the machine configuring the toolchain components: the config machine
2) the machine building the toolchain components: the build machine
3) the machine running the toolchain: the host machine
4) the machine the toolchain is generating code for: the target machine
We can most of the time assume that the config machine and the build machine
are the same. Most of the time, this will be true. The only time it isn't
is if you're using distributed compilation (such as distcc). Let's forget
this for the sake of simplicity.
So we're left with three machines:
- build
- host
- target
Any toolchain will involve those three machines. You can be as pretty sure of
this as "2 and 2 are 4". Here is how they come into play:
1) build == host == target
This is a plain native toolchain, targeting the exact same machine as the
one it is built on, and running again on this exact same machine. You have
to build such a toolchain when you want to use an updated component, such
as a newer gcc for example.
crosstool-NG calls it "native".
2) build == host != target
This is a classic cross-toolchain, which is expected to be run on the same
machine it is compiled on, and generate code to run on a second machine,
the target.
crosstool-NG calls it "cross".
3) build != host == target
Such a toolchain is also a native toolchain, as it targets the same machine
as it runs on. But it is build on another machine. You want such a
toolchain when porting to a new architecture, or if the build machine is
much faster than the host machine.
crosstool-NG calls it "cross-native".
4) build != host != target
This one is called a canadian-toolchain (*), and is tricky. The three
machines in play are different. You might want such a toolchain if you
have a fast build machine, but the users will use it on another machine,
and will produce code to run on a third machine.
crosstool-NG calls it "canadian".
crosstool-NG can build all these kinds of toolchains (or is aiming at it,
anyway!)
(*) The term Canadian Cross came about because at the time that these issues
were all being hashed out, Canada had three national political parties.
http://en.wikipedia.org/wiki/Cross_compiler

View File

@ -0,0 +1,69 @@
File.........: 7 - Contributing to crosstool-NG.txt
Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@free.fr>
License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
Contributing to crosstool-NG /
_____________________________/
Sending a bug report |
---------------------+
If you need to send a bug report, please send a mail with subject
prefixed with "[CT_NG]" with to following destinations:
TO: yann.morin.1998 (at) free.fr
CC: crossgcc (at) sourceware.org
Sending patches |
----------------+
If you want to enhance crosstool-NG, there's a to-do list in the TODO file.
When updating a package, please include the category and component in the
start of the description. For example:
cc/gcc: update to the Linaro 2011.09 release
Here is the (mostly-complete) list of categories and components:
Categories | Components
------------+-------------------------------------------------------
arch | alpha, arm, mips, powerpc...
cc | gcc
binutils | binutils, elf2flt, sstrip
libc | eglibc, uClibc, glibc, newlib, mingw, none
kernel | linux, mingw32, bare-metal
debug | dmalloc, duma, gdb, ltrace, strace
complibs | gmp, mpfr, ppl, cloog, mpc, libelf
comptools | make, m4, autoconf, automake, libtool
------------+-------------------------------------------------------
| The following categories have no component-part:
samples | when adding/updating/removing a sample
kconfig | for stuff in the kconfig/ dir
docs | for changes to the documentation
configure | for changes to ./configure and/or Makefile.in
config | for stuff in config/ not covered above
scripts | for stuff in scripts/ not covered above
Patches should come with the appropriate SoB line. A SoB line is typically
something like:
Signed-off-by: John DOE <john.doe@somewhere.net>
The SoB line is clearly described in Documentation/SubmittingPatches , section
12, of your favourite Linux kernel source tree.
Add the following to your ~/.hgrc to make Mercurial check for the SoB
line when committing:
[hooks]
pretxncommit.signoff = hg log --template '{desc}\n' -r $HG_NODE \
| grep -qi '^signed-off-by:'
You can also add any of the following lines if applicable:
Acked-by:
Tested-by:
Reviewed-by:
For larger or more frequent contributions, mercurial should be used.
There is a nice, complete and step-by-step tutorial in section 'C'.

View File

@ -0,0 +1,294 @@
File.........: 8 - Internals.txt
Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@free.fr>
License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
Internals /
__________/
Internally, crosstool-NG is script-based. To ease usage, the frontend is
Makefile-based.
Makefile front-end |
-------------------+
The entry point to crosstool-NG is the Makefile script "ct-ng". Calling this
script with an action will act exactly as if the Makefile was in the current
working directory and make was called with the action as rule. Thus:
ct-ng menuconfig
is equivalent to having the Makefile in CWD, and calling:
make menuconfig
Having ct-ng as it is avoids copying the Makefile everywhere, and acts as a
traditional command.
ct-ng loads sub- Makefiles from the library directory $(CT_LIB_DIR), as set up
at configuration time with ./configure.
ct-ng also searches for config files, sub-tools, samples, scripts and patches in
that library directory.
Because of a stupid make behavior/bug I was unable to track down, implicit make
rules are disabled: installing with --local would trigger those rules, and mconf
was unbuildable.
Kconfig parser |
---------------+
The kconfig language is a hacked version, vampirised from the Linux kernel
(http://www.kernel.org/), and (heavily) adapted to my needs.
The list of the most notable changes (at least the ones I remember) follows:
- the CONFIG_ prefix has been replaced with CT_
- a leading | in prompts is skipped, and subsequent leading spaces are not
trimmed; otherwise leading spaces are silently trimmed
- removed the warning about undefined environment variable
The kconfig parsers (conf and mconf) are not installed pre-built, but as
source files. Thus you can have the directory where crosstool-NG is installed,
exported (via NFS or whatever) and have clients with different architectures
use the same crosstool-NG installation, and most notably, the same set of
patches.
Architecture-specific |
----------------------+
Note: this chapter is not really well written, and might thus be a little bit
complex to understand. To get a better grasp of what an architecture is, the
reader is kindly encouraged to look at the "arch/" sub-directory, and to the
existing architectures to see how things are laid out.
An architecture is defined by:
- a human-readable name, in lower case letters, with numbers as appropriate.
The underscore is allowed; space and special characters are not.
Eg.: arm, x86_64
- a file in "config/arch/", named after the architecture's name, and suffixed
with ".in".
Eg.: config/arch/arm.in
- a file in "scripts/build/arch/", named after the architecture's name, and
suffixed with ".sh".
Eg.: scripts/build/arch/arm.sh
The architecture's ".in" file API:
> the config option "ARCH_%arch%" (where %arch% is to be replaced with the
actual architecture name).
That config option must have *neither* a type, *nor* a prompt! Also, it can
*not* depend on any other config option (EXPERIMENTAL is managed as above).
Eg.:
config ARCH_arm
+ mandatory:
defines a (terse) help entry for this architecture:
Eg.:
config ARCH_arm
help
The ARM architecture.
+ optional:
selects adequate associated config options.
Note: 64-bit architectures *shall* select ARCH_64
Eg.:
config ARCH_arm
select ARCH_SUPPORTS_BOTH_ENDIAN
select ARCH_DEFAULT_LE
help
The ARM architecture.
Eg.:
config ARCH_x86_64
select ARCH_64
help
The x86_64 architecture.
> other target-specific options, at your discretion. Note however that to
avoid name-clashing, such options shall be prefixed with "ARCH_%arch%",
where %arch% is again replaced by the actual architecture name.
(Note: due to historical reasons, and lack of time to clean up the code,
I may have left some config options that do not completely conform to
this, as the architecture name was written all upper case. However, the
prefix is unique among architectures, and does not cause harm).
The architecture's ".sh" file API:
> the function "CT_DoArchTupleValues"
+ parameters: none
+ environment:
- all variables from the ".config" file,
- the two variables "target_endian_eb" and "target_endian_el" which are
the endianness suffixes
+ return value: 0 upon success, !0 upon failure
+ provides:
- mandatory
- the environment variable CT_TARGET_ARCH
- contains:
the architecture part of the target tuple.
Eg.: "armeb" for big endian ARM
"i386" for an i386
+ provides:
- optional
- the environment variable CT_TARGET_SYS
- contains:
the system part of the target tuple.
Eg.: "gnu" for glibc on most architectures
"gnueabi" for glibc on an ARM EABI
- defaults to:
- for glibc-based toolchain: "gnu"
- for uClibc-based toolchain: "uclibc"
+ provides:
- optional
- the environment variables to configure the cross-gcc (defaults)
- CT_ARCH_WITH_ARCH : the gcc ./configure switch to select architecture level ( "--with-arch=${CT_ARCH_ARCH}" )
- CT_ARCH_WITH_ABI : the gcc ./configure switch to select ABI level ( "--with-abi=${CT_ARCH_ABI}" )
- CT_ARCH_WITH_CPU : the gcc ./configure switch to select CPU instruction set ( "--with-cpu=${CT_ARCH_CPU}" )
- CT_ARCH_WITH_TUNE : the gcc ./configure switch to select scheduling ( "--with-tune=${CT_ARCH_TUNE}" )
- CT_ARCH_WITH_FPU : the gcc ./configure switch to select FPU type ( "--with-fpu=${CT_ARCH_FPU}" )
- CT_ARCH_WITH_FLOAT : the gcc ./configure switch to select floating point arithmetics ( "--with-float=soft" or /empty/ )
+ provides:
- optional
- the environment variables to pass to the cross-gcc to build target binaries (defaults)
- CT_ARCH_ARCH_CFLAG : the gcc switch to select architecture level ( "-march=${CT_ARCH_ARCH}" )
- CT_ARCH_ABI_CFLAG : the gcc switch to select ABI level ( "-mabi=${CT_ARCH_ABI}" )
- CT_ARCH_CPU_CFLAG : the gcc switch to select CPU instruction set ( "-mcpu=${CT_ARCH_CPU}" )
- CT_ARCH_TUNE_CFLAG : the gcc switch to select scheduling ( "-mtune=${CT_ARCH_TUNE}" )
- CT_ARCH_FPU_CFLAG : the gcc switch to select FPU type ( "-mfpu=${CT_ARCH_FPU}" )
- CT_ARCH_FLOAT_CFLAG : the gcc switch to choose floating point arithmetics ( "-msoft-float" or /empty/ )
- CT_ARCH_ENDIAN_CFLAG : the gcc switch to choose big or little endian ( "-mbig-endian" or "-mlittle-endian" )
- default to:
see above.
+ provides:
- optional
- the environment variables to configure the core and final compiler, specific to this architecture:
- CT_ARCH_CC_CORE_EXTRA_CONFIG : additional, architecture specific core gcc ./configure flags
- CT_ARCH_CC_EXTRA_CONFIG : additional, architecture specific final gcc ./configure flags
- default to:
- all empty
+ provides:
- optional
- the architecture-specific CFLAGS and LDFLAGS:
- CT_ARCH_TARGET_CLFAGS
- CT_ARCH_TARGET_LDFLAGS
- default to:
- all empty
You can have a look at "config/arch/arm.in" and "scripts/build/arch/arm.sh" for
a quite complete example of what an actual architecture description looks like.
Kernel specific |
----------------+
A kernel is defined by:
- a human-readable name, in lower case letters, with numbers as appropriate.
The underscore is allowed; space and special characters are not (although
they are internally replaced with underscores.
Eg.: linux, bare-metal
- a file in "config/kernel/", named after the kernel name, and suffixed with
".in".
Eg.: config/kernel/linux.in, config/kernel/bare-metal.in
- a file in "scripts/build/kernel/", named after the kernel name, and suffixed
with ".sh".
Eg.: scripts/build/kernel/linux.sh, scripts/build/kernel/bare-metal.sh
The kernel's ".in" file must contain:
> an optional lines containing exactly "# EXPERIMENTAL", starting on the
first column, and without any following space or other character.
If this line is present, then this kernel is considered EXPERIMENTAL,
and correct dependency on EXPERIMENTAL will be set.
> the config option "KERNEL_%kernel_name%" (where %kernel_name% is to be
replaced with the actual kernel name, with all special characters and
spaces replaced by underscores).
That config option must have *neither* a type, *nor* a prompt! Also, it can
*not* depends on EXPERIMENTAL.
Eg.: KERNEL_linux, KERNEL_bare_metal
+ mandatory:
defines a (terse) help entry for this kernel.
Eg.:
config KERNEL_bare_metal
help
Build a compiler for use without any kernel.
+ optional:
selects adequate associated config options.
Eg.:
config KERNEL_bare_metal
select BARE_METAL
help
Build a compiler for use without any kernel.
> other kernel specific options, at your discretion. Note however that, to
avoid name-clashing, such options should be prefixed with
"KERNEL_%kernel_name%", where %kernel_name% is again tp be replaced with
the actual kernel name.
(Note: due to historical reasons, and lack of time to clean up the code,
I may have left some config options that do not completely conform to
this, as the kernel name was written all upper case. However, the prefix
is unique among kernels, and does not cause harm).
The kernel's ".sh" file API:
> is a bash script fragment
> defines the function CT_DoKernelTupleValues
+ see the architecture's CT_DoArchTupleValues, except for:
+ set the environment variable CT_TARGET_KERNEL, the kernel part of the
target tuple
+ return value: ignored
> defines the function "do_kernel_get":
+ parameters: none
+ environment:
- all variables from the ".config" file.
+ return value: 0 for success, !0 for failure.
+ behavior: download the kernel's sources, and store the tarball into
"${CT_TARBALLS_DIR}". To this end, a functions is available, that
abstracts downloading tarballs:
- CT_DoGet <tarball_base_name> <URL1 [URL...]>
Eg.: CT_DoGet linux-2.6.26.5 ftp://ftp.kernel.org/pub/linux/kernel/v2.6
Note: retrieving sources from svn, cvs, git and the likes is not supported
by CT_DoGet. You'll have to do this by hand, as it is done for eglibc in
"scripts/build/libc/eglibc.sh"
> defines the function "do_kernel_extract":
+ parameters: none
+ environment:
- all variables from the ".config" file,
+ return value: 0 for success, !0 for failure.
+ behavior: extract the kernel's tarball into "${CT_SRC_DIR}", and apply
required patches. To this end, a function is available, that abstracts
extracting tarballs:
- CT_ExtractAndPatch <tarball_base_name>
Eg.: CT_ExtractAndPatch linux-2.6.26.5
> defines the function "do_kernel_headers":
+ parameters: none
+ environment:
- all variables from the ".config" file,
+ return value: 0 for success, !0 for failure.
+ behavior: install the kernel headers (if any) in "${CT_SYSROOT_DIR}/usr/include"
> defines any kernel-specific helper functions
These functions, if any, must be prefixed with "do_kernel_%CT_KERNEL%_",
where '%CT_KERNEL%' is to be replaced with the actual kernel name, to avoid
any name-clashing.
You can have a look at "config/kernel/linux.in" and "scripts/build/kernel/linux.sh"
as an example of what a complex kernel description looks like.
Adding a new version of a component |
------------------------------------+
When a new component, such as the Linux kernel, gcc or any other is released,
adding the new version to crosstool-NG is quite easy. There is a script that
will do all that for you:
scripts/addToolVersion.sh
Run it with no option to get some help.
Build scripts |
--------------+
To Be Written later...

View File

@ -0,0 +1,253 @@
File.........: 9 - Build procedure overview.txt
Copyright....: (C) 2011 Yann E. MORIN <yann.morin.1998@free.fr>
License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
How is a toolchain constructed? /
_______________________________/
This is the result of a discussion with Francesco Turco <mail@fturco.org>:
http://sourceware.org/ml/crossgcc/2011-01/msg00060.html
Francesco has a nice tutorial for beginners, along with a sample, step-by-
step procedure to build a toolchain for an ARM target from an x86_64 Debian
host:
http://fturco.org/wiki/doku.php?id=debian:cross-compiler
Thank you Francesco for initiating this!
I want a cross-compiler! What is this toolchain you're speaking about? |
-----------------------------------------------------------------------+
A cross-compiler is in fact a collection of different tools set up to
tightly work together. The tools are arranged in a way that they are
chained, in a kind of cascade, where the output from one becomes the
input to another one, to ultimately produce the actual binary code that
runs on a machine. So, we call this arrangement a "toolchain". When
a toolchain is meant to generate code for a machine different from the
machine it runs on, this is called a cross-toolchain.
So, what are those components in a toolchain? |
----------------------------------------------+
The components that play a role in the toolchain are first and foremost
the compiler itself. The compiler turns source code (in C, C++, whatever)
into assembly code. The compiler of choice is the GNU compiler collection,
well known as 'gcc'.
The assembly code is interpreted by the assembler to generate object code.
This is done by the binary utilities, such as the GNU 'binutils'.
Once the different object code files have been generated, they got to get
aggregated together to form the final executable binary. This is called
linking, and is achieved with the use of a linker. The GNU 'binutils' also
come with a linker.
So far, we get a complete toolchain that is capable of turning source code
into actual executable code. Depending on the Operating System, or the lack
thereof, running on the target, we also need the C library. The C library
provides a standard abstraction layer that performs basic tasks (such as
allocating memory, printing output on a terminal, managing file access...).
There are many C libraries, each targeted to different systems. For the
Linux /desktop/, there is glibc or eglibc or even uClibc, for embedded Linux,
you have a choice of eglibc or uClibc, while for system without an Operating
System, you may use newlib, dietlibc, or even none at all. There a few other
C libraries, but they are not as widely used, and/or are targeted to very
specific needs (eg. klibc is a very small subset of the C library aimed at
building constrained initial ramdisks).
Under Linux, the C library needs to know the API to the kernel to decide
what features are present, and if needed, what emulation to include for
missing features. That API is provided by the kernel headers. Note: this
is Linux-specific (and potentially a very few others), the C library on
other OSes do not need the kernel headers.
And now, how do all these components chained together? |
-------------------------------------------------------+
So far, all major components have been covered, but yet there is a specific
order they need to be built. Here we see what the dependencies are, starting
with the compiler we want to ultimately use. We call that compiler the
'final compiler'.
- the final compiler needs the C library, to know how to use it,
but:
- building the C library requires a compiler
A needs B which needs A. This is the classic chicken'n'egg problem... This
is solved by building a stripped-down compiler that does not need the C
library, but is capable of building it. We call it a bootstrap, initial, or
core compiler. So here is the new dependency list:
- the final compiler needs the C library, to know how to use it,
- building the C library requires a core compiler
but:
- the core compiler needs the C library headers and start files, to know
how to use the C library
B needs C which needs B. Chicken'n'egg, again. To solve this one, we will
need to build a C library that will only install its headers and start
files. The start files are a very few files that gcc needs to be able to
turn on thread local storage (TLS) on an NPTL system. So now we have:
- the final compiler needs the C library, to know how to use it,
- building the C library requires a core compiler
- the core compiler needs the C library headers and start files, to know
how to use the C library
but:
- building the start files require a compiler
Geez... C needs D which needs C, yet again. So we need to build a yet
simpler compiler, that does not need the headers and does need the start
files. This compiler is also a bootstrap, initial or core compiler. In order
to differentiate the two core compilers, let's call that one "core pass 1",
and the former one "core pass 2". The dependency list becomes:
- the final compiler needs the C library, to know how to use it,
- building the C library requires a compiler
- the core pass 2 compiler needs the C library headers and start files,
to know how to use the C library
- building the start files requires a compiler
- we need a core pass 1 compiler
And as we said earlier, the C library also requires the kernel headers.
There is no requirement for the kernel headers, so end of story in this
case:
- the final compiler needs the C library, to know how to use it,
- building the C library requires a core compiler
- the core pass 2 compiler needs the C library headers and start files,
to know how to use the C library
- building the start files requires a compiler and the kernel headers
- we need a core pass 1 compiler
We need to add a few new requirements. The moment we compile code for the
target, we need the assembler and the linker. Such code is, of course,
built from the C library, so we need to build the binutils before the C
library start files, and the complete C library itself. Also, some code
in gcc will turn to run on the target as well. Luckily, there is no
requirement for the binutils. So, our dependency chain is as follows:
- the final compiler needs the C library, to know how to use it, and the
binutils
- building the C library requires a core pass 2 compiler and the binutils
- the core pass 2 compiler needs the C library headers and start files,
to know how to use the C library, and the binutils
- building the start files requires a compiler, the kernel headers and the
binutils
- the core pass 1 compiler needs the binutils
Which turns in this order to build the components:
1 binutils
2 core pass 1 compiler
3 kernel headers
4 C library headers and start files
5 core pass 2 compiler
6 complete C library
7 final compiler
Yes! :-) But are we done yet?
In fact, no, there are still missing dependencies. As far as the tools
themselves are involved, we do not need anything else.
But gcc has a few pre-requisites. It relies on a few external libraries to
perform some non-trivial tasks (such as handling complex numbers in
constants...). There are a few options to build those libraries. First, one
may think to rely on a Linux distribution to provide those libraries. Alas,
they were not widely available until very, very recently. So, if the distro
is not too recent, chances are that we will have to build those libraries
(which we do below). The affected libraries are:
- the GNU Multiple Precision Arithmetic Library, GMP
- the C library for multiple-precision floating-point computations with
correct rounding, MPFR
- the C library for the arithmetic of complex numbers, MPC
The dependencies for those libraries are:
- MPC requires GMP and MPFR
- MPFR requires GMP
- GMP has no pre-requisite
So, the build order becomes:
1 GMP
2 MPFR
3 MPC
4 binutils
5 core pass 1 compiler
6 kernel headers
7 C library headers and start files
8 core pass 2 compiler
9 complete C library
10 final compiler
Yes! Or yet some more?
This is now sufficient to build a functional toolchain. So if you've had
enough for now, you can stop here. Or if you are curious, you can continue
reading.
gcc can also make use of a few other external libraries. These additional,
optional libraries are used to enable advanced features in gcc, such as
loop optimisation (GRAPHITE) and Link Time Optimisation (LTO). If you want
to use these, you'll need three additional libraries:
To enable GRAPHITE:
- the Parma Polyhedra Library, PPL
- the Chunky Loop Generator, using the PPL backend, CLooG/PPL
To enable LTO:
- the ELF object file access library, libelf
The dependencies for those libraries are:
- PPL requires GMP
- CLooG/PPL requires GMP and PPL
- libelf has no pre-requisites
The list now looks like (optional libs with a *):
1 GMP
2 MPFR
3 MPC
4 PPL *
5 CLooG/PPL *
6 libelf *
7 binutils
8 core pass 1 compiler
9 kernel headers
10 C library headers and start files
11 core pass 2 compiler
12 complete C library
13 final compiler
This list is now complete! Wouhou! :-)
So the list is complete. But why does crosstool-NG have more steps? |
--------------------------------------------------------------------+
The already thirteen steps are the necessary steps, from a theoretical point
of view. In reality, though, there are small differences; there are three
different reasons for the additional steps in crosstool-NG.
First, the GNU binutils do not support some kinds of output. It is not possible
to generate 'flat' binaries with binutils, so we have to use another component
that adds this support: elf2flt. Another binary utility called sstrip has been
added. It allows for super-stripping the target binaries, although it is not
strictly required.
Second, crosstool-NG can also build some additional debug utilities to run on
the target. This is where we build, for example, the cross-gdb, the gdbserver
and the native gdb (the last two run on the target, the first runs on the
same machine as the toolchain). The others (strace, ltrace, DUMA and dmalloc)
are absolutely not related to the toolchain, but are nice-to-have stuff that
can greatly help when developing, so are included as goodies (and they are
quite easy to build, so it's OK; more complex stuff is not worth the effort
to include in crosstool-NG).

View File

@ -0,0 +1,90 @@
File.........: A - Credits.txt
Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@free.fr>
License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
Credits /
________/
I would like to thank these fine people for making crosstool-NG possible:
Dan KEGEL, the original author of crosstool: http://www.kegel.com/
Dan was very helpfull and willing to help when I build my first toolchains.
I owe him one. Thank you Dan!
Some crosstool-NG scripts have code snippets coming almost as-is from the
original work by Dan.
And in order of appearance on the crossgcc ML:
Allan CLARK for his investigations on building toolchains on MacOS-X.
Allan made extensive tests of the first alpha of crosstool-NG on his
MacOS-X, and unveiled some bash-2.05 weirdness.
Enrico WEIGELT
- some improvements to the build procedure
- cxa_atexit disabling for C libraries not supporting it (old uClibc)
- misc suggestions (restartable build, ...)
- get rid of some bashisms in ./configure
- contributed OpenRISC or32 support
Robert P. J. DAY:
- some small improvements to the configurator, misc prompting glitches
- 'sanitised' patches for binutils-2.17
- patches for glibc-2.5
- misc patches, typos and eye candy
- too many to list any more!
Al Stone:
- initial ia64 support
- some cosmetics
Szilveszter Ordog:
- a uClibc floating point fix
- initial support for ARM EABI
Mark Jonas:
- initiated Super-H port
Michael Abbott:
- make it build with ancient findutils
Willy Tarreau:
- a patch to glibc to build on 'ancient' shells
- reported mis-use of $CT_CC_NATIVE
Matthias Kaehlcke:
- fix building glibc-2.7 (and 2.6.1) with newer kernels
Daniel Dittmann:
- PowerPC support
Ioannis E. Venetis:
- preliminary Alpha support
- intense gcc-4.3 brainstorming
Thomas Jourdan:
- intense gcc-4.3 brainstorming
- eglibc support
Konrad Eisele:
- initial multlilib support:
http://sourceware.org/ml/crossgcc/2011-11/msg00040.html
Many others have contributed, either in form of patches, suggestions,
comments, or testing... Thank you to all of you!
Special dedication to the buildroot people for maintaining a set of patches I
happily and shamelessly vampirise from time to time... :-)
20100530: Status of this file
It's been about a year now that we've moved the repository to Mercurial.
The repository now has proper authorship for each changeset, and this is
used to build the changelog at each release. This file will probably no
longer be updated, and is here to credit people prior to the Mercurial
migration, or for people discussing ideas or otherwise helping without
code.
If you think you deserve being cited in this file, do yell at me! ;-)

View File

@ -0,0 +1,255 @@
File.........: B - Known issues.txt
Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@free.fr>
License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
Known issues /
_____________/
This files lists the known issues encountered while developing crosstool-NG,
but that could not be addressed before the release.
The file has one section for each known issue, each section containing four
sub-sections: Symptoms, Explanations, Fix, and Workaround.
Each section is separated from the others with a lines of at least 4 dashes.
The following dummy section explains it all.
--------------------------------
Symptoms:
A one- or two-liner of what you would observe.
Usually, the error message you would see in the build logs.
Explanations:
An as much as possible in-depth explanations of the context, why it
happens, what has been investigated so far, and possible orientations
as how to try to solve this (eg. URLs, code snippets...).
Status:
Tells about the status of the issue:
UNCONFIRMED : missing information, or unable, to reproduce, but there
is consensus that there is an issue somewhere...
CURRENT : the issue is applicable.
DEPRECATED : the issue used to apply in some cases, but has not been
confirmed or reported again lately.
CLOSED : the issue is no longer valid, and a fix has been added
either as a patch to this component, and/or as a
workaround in the scripts and/or the configuration.
Fix:
What you have to do to fix it, if at all possible.
The fact that there is a fix, and yet this is a known issue means that
time to incorporate the fix in crosstool-NG was missing, or planned for
a future release.
Workaround:
What you can do to fix it *temporarily*, if at all possible.
A workaround is not a real fix, as it can break other parts of
crosstool-NG, but at least makes you going in your particular case.
So now, on for the real issues...
--------------------------------
Symptoms:
gcc is not found, although I *do* have gcc installed.
Explanations:
This is an issue on at least RHEL systems, where gcc is a symlink to ccache.
Because crosstool-NG create links to gcc for the build and host environment,
those symlinks are in fact pointing to ccache, which then doesn't know how
to run the compiler.
A possible fix could probably set the environment variable CCACHE_CC to the
actual compiler used.
Status:
CURRENT
Fix:
None known.
Workaround:
Uninstall ccache.
--------------------------------
Symptoms:
The extract and/or path steps fail under Cygwin.
Explanations:
This is not related to crosstool-NG. Mounts under Cygwin are by default not
case-sensitive. You have to use so-called "managed" mounts. See:
http://cygwin.com/faq.html section 4, question 32.
Status:
DEPRECATED
Fix:
Use "managed" mounts for the directories where you build *and* install your
toolchains.
Workaround:
None.
--------------------------------
Symptoms:
uClibc fails to build under Cygwin.
Explanations:
With uClibc, it is possible to build a cross-ldd. Unfortunately, it is
not (currently) possible to build this cross-ldd under Cygwin.
Status:
DEPRECATED
Fix:
None so far.
Workaround:
Disable the cross-ldd build.
--------------------------------
Symptoms:
On 64-bit build systems, the glibc (possibly eglibc too) build fails for
64-bit targets, because it can not find libgcc.
Explanations:
This issue has been observed when the companion libraries are built
statically. For an unknown reason, in this case, the libgcc built by the
core gcc is not located in the same place it is located when building
with shared companion libraries.
Status:
DEPRECATED
Fix:
None so far.
Workaround:
Build shared companion libraries.
--------------------------------
Symptoms:
libtool.m4: error: problem compiling FC test program
Explanations:
The gcc build procedure tries to run a Fortran test to see if it has a
working native fortran compiler installed on the build machine, and it
can't find one. A native Fortran compiler is needed (seems to be needed)
to build the Fortran frontend of the cross-compiler.
Even if you don't want to build the Fortran frontend, gcc tries to see
if it has one, but fails. This is no problem, as the Fortran frontend
will not be built. There is nothing to be worry about (unless you do
want to build the Fortran frontend, of course).
Status:
CURRENT
Fix:
None so far. It's a spurious error, so there will probably never be
a fix for this issue.
Workaround:
None needed, it's a spurious error.
--------------------------------
Symptoms:
unable to detect the exception model
Explanations:
On some architectures, proper stack unwinding (C++) requires that
setjmp/longjmp (sjlj) be used, while on other architectures do not
need sjlj. On some architectures, gcc is unable to determine whether
sjlj are needed or not.
Status:
CURRENT
Fix:
None so far.
Workaround:
Trying setting use of sjlj to either 'Y' or 'N' (instead of the
default 'M') in the menuconfig, option CT_CC_GCC_SJLJ_EXCEPTIONS
labelled "Use sjlj for exceptions".
--------------------------------
Symptoms:
configure: error: forced unwind support is required
Explanations:
The issue seems to be related to building NPTL on old versions
of glibc (and possibly eglibc as well) on some architectures
(seen on powerpc, s390, s390x and x86_64).
Status:
CURRENT
Fix:
None so far. It would require some glibc hacking.
Workaround:
Try setting "Force unwind support" in the "C-library" menu.
--------------------------------
Symptoms:
glibc start files and headers fail with: [/usr/include/limits.h] Error 1
Explanations:
Old glibc (and eglibc) Makefiles break with make-3.82.
Status:
CURRENT
Fix:
None so far. It would require some glibc/eglibc hacking.
Workaround:
There two possible workarounds:
1- ask crosstool-NG to build make-3.81 just for this build session:
Select the following options:
Paths and misc options --->
[*] Try features marked as EXPERIMENTAL
Companion tools --->
[*] Build some companion tools
[*] make
2- manually install make-3.81 to take precedence over the system make.
--------------------------------
Symptoms:
The build fails with "mixed implicit and normal rules. Stop."
Explanations:
Old glibc (and eglibc) Makefiles break with make-3.82.
Status:
CURRENT
Fix:
None so far. See above issue.
Workaround:
See above issue.
--------------------------------
Symptoms:
On x86_64 hosts with 32bit userspace the GMP build fails with:
configure: error: Oops, mp_limb_t is 32 bits, but the assembler code
in this configuration expects 64 bits.
You appear to have set $CFLAGS, perhaps you also need to tell GMP the
intended ABI, see "ABI and ISA" in the manual.
Explanations:
"uname -m" detects x86_64 but the build host is really x86.
Status:
CURRENT
Fix:
None so far. See above issue.
Workaround:
use "setarch i686 ct-ng build"
--------------------------------

View File

@ -0,0 +1,308 @@
File.........: C - Misc. tutorials.txt
Copyright....: (C) 2010 Yann E. MORIN <yann.morin.1998@free.fr>
License......: Creative Commons Attribution Share Alike (CC-by-sa), v2.5
Misc. tutorials /
________________/
Using crosstool-NG on FreeBSD (and other *BSD) |
-----------------------------------------------+
Contributed by: Titus von Boxberg
Prerequisites and instructions for using ct-ng for building a cross toolchain on FreeBSD as host.
0) Tested on FreeBSD 8.0
1) Install (at least) the following ports
archivers/lzma
textproc/gsed
devel/gmake
devel/patch
shells/bash
devel/bison
lang/gawk
devel/automake110
ftp/wget
Of course, you should have /usr/local/bin in your PATH.
2) run ct-ng's configure with the following tool configuration:
./configure --with-sed=/usr/local/bin/gsed --with-make=/usr/local/bin/gmake \
--with-patch=/usr/local/bin/gpatch
[...other configure parameters as you like...]
3) proceed as described in general documentation
but use gmake instead of make
Using crosstool-NG on MacOS-X |
------------------------------+
Contributed by: Titus von Boxberg
Prerequisites and instructions for using crosstool-NG for building a cross
toolchain on MacOS as host.
0) Mac OS Snow Leopard, with Developer Tools 3.2 installed, or
Mac OS Leopard, with Developer Tools & newer gcc (>= 4.3) installed
via macports
1) You have to use a case sensitive file system for ct-ng's build and target
directories. Use a disk or disk image with a case sensitive fs that you
mount somewhere.
2) Install macports (or similar easy means of installing 3rd party software),
make sure that macport's bin dir is in the front (!) of your PATH.
Furtheron assuming it is /opt/local/bin.
3) Install (at least) the following macports
lzmautils
libtool
binutils
gsed
gawk
gcc43 (only necessary for Leopard OSX 10.5)
gcc_select (only necessary for OSX 10.5, or Xcode > 4)
4) Prerequisites
On Leopard, make sure that the macport's gcc is called with the default
commands (gcc, g++,...), via macport's gcc_select
On OSX 10.7 Lion / when using Xcode >= 4 make sure that the default commands
(gcc, g++, etc.) point to gcc-4.2, NOT llvm-gcc-4.2
by using macport's gcc_select feature. With MacPorts >= 1.9.2
the command is: "sudo port select --set gcc gcc42"
This also requires (like written above) that macport's bin dir
comes before standard directories in your PATH environment variable
because the gcc symlink is installed in /opt/local/bin and the default /usr/bin/gcc
is not removed by the gcc select command!
Explanation: llvm-gcc-4.2 (with Xcode 4.1 it is on my machine
"gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)")
cannot boostrap gcc. See http://llvm.org/bugs/show_bug.cgi?id=9571
5) run ct-ng's configure with the following tool configuration
(assuming you have installed the tools via macports in /opt/local):
./configure --with-sed=/opt/local/bin/gsed \
--with-libtool=/opt/local/bin/glibtool \
--with-libtoolize=/opt/local/bin/glibtoolize \
--with-objcopy=/opt/local/bin/gobjcopy \
--with-objdump=/opt/local/bin/gobjdump \
--with-readelf=/opt/local/bin/greadelf \
[...other configure parameters as you like...]
6) proceed as described in standard documentation
-----
HINTS:
- Apparently, GNU make's builtin variable .LIBPATTERNS is misconfigured
under MacOS: It does not include lib%.dylib.
This affects build of (at least) gdb-7.1
Put 'lib%.a lib%.so lib%.dylib' as .LIBPATTERNS into your environment
before executing ct-ng build.
See http://www.gnu.org/software/make/manual/html_node/Libraries_002fSearch.html
as an explanation.
- ct-ng menuconfig will not work on Snow Leopard 10.6.3 since libncurses
is broken with this release. MacOS <= 10.6.2 and >= 10.6.4 are ok.
Using Mercurial to hack crosstool-NG |
-------------------------------------+
Contributed by: Titus von Boxberg
PREREQUISITES:
Configuring Mercurial:
You need mercurial with the following extensions:
- mq : http://mercurial.selenic.com/wiki/MqExtension
- patchbomb : http://mercurial.selenic.com/wiki/PatchbombExtension
Usually, these two extensions are already part of the installation package.
The mq extension maintains a separate queue of your local changes
that you can change at any later time.
With the patchbomb extension you can email those patches directly
from your local repo.
Your configuration file for mercurial, e.g. ~/.hgrc should contain
at least the following sections (but have a look at `man hgrc`):
# ---
[email]
# configure sending patches directly via Mercurial
from = "Your Name" <your@email.address>
# How to send email:
method = smtp
[smtp]
# SMTP configuration (only for method=smtp)
host = localhost
tls = true
username =
password =
[extensions]
# The following lines enable the two extensions:
hgext.mq =
hgext.patchbomb =
# ----
Create your local repository as a clone:
hg clone http://crosstool-ng.org/hg/crosstool-ng crosstool-ng
Setting up the mq extension in your local copy:
cd crosstool-ng
hg qinit
CREATING PATCHES:
Recording your changes in the patch queue maintained by mq:
# First, create a new patch entry in the patch queue:
hg qnew -D -U -e short_patch_name1
<edit patch description as commit message (see below for an example)>
<now edit the ct-ng sources and check them>
# if you execute `hg status` here, your modifications of the working
# copy should show up.
# Now the following command takes your modifications from the working copy
# into the patch entry
hg qrefresh -D [-e]
<reedit patch description [-e] if desired>
# Now your changes are recorded, and `hg status` should show a clean
# working copy
Repeat the above steps for all your modifications.
The command `hg qseries` informs you about the content of your patch queue.
CONTRIBUTING YOUR PATCHES:
Once you are satisfied with your patch series, you can (you should!)
contribute them back to upstream.
This is easily done using the `hg email` command.
`hg email` sends your new changesets to a specified list of recipients,
each patch in its own email, all ordered in the way you entered them (oldest
first). The command line flag --outgoing selects all changesets that are in
your local but not yet in the upstream repository. Here, these are exactly
the ones you entered into your local patch queue in the section above, so
--outgoing is what you want.
Each email gets the subject set to: "[PATCH x of n] <series summary>"
where 'x' is the serial number in the email series, and 'n' is the total number
of patches in the series. The body of the email is the complete patch, plus
a handful of metadata, that helps properly apply the patch, keeping the log
message, attribution and date, tracking file changes (move, delete, modes...)
`hg email` also threads all outgoing patch emails below an introductory
message. You should use the introductory message (command line flag --intro)
to describe the scope and motivation for the whole patch series. The subject
for the introductory message gets set to: "[PATCH 0 of n] <series summary>"
and you get the chance to set the <series summary>.
Here is a sample `hg email` complete command line:
Note: replace " (at) " with "@"
hg email --outgoing --intro \
--to '"Yann E. MORIN" <yann.morin.1998 (at) free.fr>' \
--cc 'crossgcc (at) sourceware.org'
# It then opens an editor and lets you enter the subject
# and the body for the introductory message.
Use `hg email` with the additional command line switch -n to
first have a look at the email(s) without actually sending them.
MAINTAINING YOUR PATCHES:
When the patches are refined by discussing them on the mailing list,
you may want to finalize and resend them.
The mq extension has the idiosyncrasy of imposing a stack onto the queue:
You can always reedit/refresh only the patch on top of stack.
The queue consists of applied and unapplied patches
(if you reached here via the above steps, all of your patches are applied),
where the 'stack' consists of the applied patches, and 'top of stack'
is the latest applied patch.
The following output of `hg qseries` is now used as an example:
0 A short_patch_name1
1 A short_patch_name2
2 A short_patch_name3
3 A short_patch_name4
You are now able to edit patch 'short_patch_name4' (which is top of stack):
<Edit the sources>
# and execute again
hg qrefresh -D [-e]
<and optionally [-e] reedit the commit message>
If you want to edit e.g. patch short_patch_name2, you have to modify
mq's stack so this patch gets top of stack.
For this purpose see `hg help qgoto`, `hg help qpop`, and `hg help qpush`.
hg qgoto short_patch_name2
# The patch queue should now look like
hg qseries
0 A short_patch_name1
1 A short_patch_name2
2 U short_patch_name3
3 U short_patch_name4
# so patch # 1 (short_patch_name2) is top of stack.
<now reedit the sources for short_patch_name2>
# and execute again
hg qrefresh -D [-e]
<and optionally [-e] reedit the commit message>
# the following command reapplies the now unapplied two patches:
hg qpush -a
# you can also use `hg qgoto short_patch_name4` to get there again.
RESENDING YOUR REEDITED PATCHES:
By mailing list policy, please resend your complete patch series.
--> Go back to section "CONTRIBUTING YOUR PATCHES" and resubmit the full set.
SYNCING WITH UPSTREAM AGAIN:
You can sync your repo with upstream at any time by executing
# first unapply all your patches:
hg qpop -a
# next fetch new changesets from upstream
hg pull
# then update your working copy
hg up
# optionally remove already upstream integrated patches (see below)
hg qdelete <short_name_of_already_applied_patch>
# and reapply your patches if any non upstream-integrated left (but see below)
hg qpush -a
Eventually, your patches get included into the upstream repository
which you initially cloned.
In this case, before executing the hg qpush -a from above
you should manually "hg qdelete" the patches that are already integrated upstream.
HOW TO FORMAT COMMIT MESSAGES (aka patch descriptions):
Commit messages should look like (without leading pipes):
|component: short, one-line description
|
|optional longer description
|on multiple lines if needed
|
|Signed-off-by: as documented in section 7 of ct-ng's documentation
Here is an example commit message (see revision 8bb5151c5b01):
kernel/linux: fix type in version strings
I missed refreshing the patch before pushing. :-(
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

View File

@ -0,0 +1,199 @@
." crosstool-NG man page
." Copyright 2007 Yann E. MORIN
." Licensed under the Creative Commons BY-SA, v2.5
."
." Beautifying URLs
.mso www.tmac
."
.TH crosstool-NG 1 "@@CT_DATE@@" "version @@CT_VERSION@@" "User Commands"
."
."
.SH NAME
@@CT_PROG_NAME@@, crosstool-NG \- Build cross-toolchains
."
."
.SH SYNOPSIS
.B @@CT_PROG_NAME@@ ACTION
."
."
.SH DESCRIPTION
Building a cross-toolchain can be a real pain.
.PP
.B crosstool-NG
makes it easy to build cross-toolchains, and allows you to take all the juice
out of your target by configuring the different components of the toolchain
according to the targeted processor.
."
."
.SH ACTIONS
Here are the most commonly used actions. For other actions, please see
.I "@@CT_DOCDIR@@/0 - Table of content.txt"
.TP
.B help
Prints a little help text.
."
.TP
.B menuconfig
Configures
.B crosstool-NG
using a configurator menu very similar to that of the Linux kernel.
."
.TP
.B oldconfig
Apply options found in an existing
.I .config
file, and ask for newer options if there are any.
."
.TP
.B saveconfig
Save the current
.B crosstool-NG
configuration, and associated components' config files, into a sample. Samples
are saved in their own sub-directory, named after the target's tuple, in the
.I samples
sub-directory of the current directory.
If that was not clear:
.I `pwd`/samples/${CT_TARGET}/
Samples can be later recalled by calling
.B @@CT_PROG_NAME@@
with the target tuple they represent.
."
.TP
.B savedefconfig
Save the current configuration to a mini-defconfig file, that contains only
the strictly required symbols to reproduce the configuration. defconfig files
are much smaller than a complete .config, so it is easy to send by mail. As
only non-default symbols are present in a defconfig, it easy to spot the
meaningful values. Also, it is easy to use defconfig files with newer
versions of
.BR crosstool-NG .
By default the mini-defconfig is saved to a file named
.IR defconfig ,
unless the variable
.B $DEFCONFIG
is set, in which case the mini-defconfig will be saved to the file referenced
by
.BR $DEFCONFIG .
Note: only the
.I .config
file for
.B crosstool-NG
is saved. Config files for the components are
.B not
saved. Use
.B saveconfig
for that
."
.TP
.B defconfig
Configure
.B crosstool-NG
using a mini-defconfig file (previously saved with
.B savedefconfig
or manually edited). The default mini-defconfig is read from the file
.IR defconfig ,
unless the variable
.B $DEFCONFIG
is set, in which case the mini-defconfig will be read from the file referenced
by
.B $DEFCONFIG
."
.TP
.B build
Builds the configured toolchain.
."
.TP
.B clean
Remove files generated by
.B crosstool-NG
for itself (these are mostly the configurators' binaries).
."
.TP
.B distclean
Same as
.B clean
, but also removes the toolchain build directory, the downloaded files and the
.I .config
configuration file. The generated toolchain is left untouched, as well as
samples which are not removed.
."
.TP
.B regtest
Calls the
.B crosstool-NG
regression test suite. All samples are build, and the regression test suite is
run against every one of them.
."
.TP
.B updatetools
Updates the
.I config.guess
and
.I config.sub
scripts. These scripts are used by
.B crosstool-NG
to canonicalise the machines' name (host, build and target machines).
.TP
.B tarball
Builds a tarball of the generated toolchain, also saving the scripts from
.B crosstool-NG
that are needed to rebuild the target, and also saving the tarballs of the
components that were used.
."
.SH ENVIRONMENT
.TP
.B STOP, START
Respectively stops and restarts the build just before this step. To restart a
step, a previous build should have run at least to that step, or further.
The list of steps is viewable with the action
.BR list-steps .
."
.SH EXIT VALUE
The
.B @@CT_PROG_NAME@@
frontend is in fact a
.BR make (1)
script. See the man page for
.BR make (1)
to have the meaning of the exit values.
."
.SH BUGS
As of today (@@CT_DATE@@), building tarballs is broken. It is difficult to
foresee how all parts of
.B crosstool-NG
are going to be installed. Each part is needed to build a tarball, as it
contains all that is needed to rebuild the toolchain from scratch: toolchain
components' sources,
.B crosstool-NG
configuration, but also all
.B crosstool-NG
scripts.
."
.SH SECURITY
.B Don't run as root!
Great care has been taken to avoid mistakes, but bug-free programs don't
exist. During normal operation,
.B crosstool-NG
removes entire directories. If you run as root, and there is a bug or you
mis-configured
.BR crosstool-NG ,
entire important directories could be removed (eg.
.IR /usr ),
although
.B crosstool-NG
will refuse to install toolchains in some well known critical directories.
."
.SH AUTHORS
Please consult the file
.I @@CT_DOCDIR@@/CREDITS
for a list of contributors.
."
.SH SEE ALSO
You can find more in-depth documentation in
.IR "@@CT_DOCDIR@@/0 - Table of content.txt" .
Please have a look at the
.URL "http://www.kegel.com/crosstool" "original crosstool" " by Daniel KEGEL"

View File

@ -0,0 +1,306 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Creative Commons Deed</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<link rel="stylesheet" type="text/css" href="deed_files/deeds.css">
<link rel="alternate" type="application/rdf+xml" href="http://creativecommons.org/licenses/by-sa/2.5/rdf">
<script language="javascript">
function setCookie(name, value, expires, path, domain, secure) {
document.cookie= name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
var expiry = new Date();
expiry.setTime(expiry.getTime()+(5*365*24*60*60*1000));
setCookie('lang','en', expiry, '/');
</script></head><body>
<!--
<rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires
rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF>
-->
<p align="center"><a href="http://creativecommons.org/">Creative Commons</a></p>
<div style="width: 620px; margin-left: auto; margin-right: auto;"><div style="text-align: center;">
This page is available in the following languages:
<br>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.bg" title="български" hreflang="bg" rel="alternate" lang="bg">български</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.ca" title="Català" hreflang="ca" rel="alternate" lang="ca">Català</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.da" title="Dansk" hreflang="da" rel="alternate" lang="da">Dansk</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.de" title="Deutsch" hreflang="de" rel="alternate" lang="de">Deutsch</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.en" title="English" hreflang="en" rel="alternate" lang="en">English</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.en_CA" title="English (CA)" hreflang="en_CA" rel="alternate" lang="en_CA">English (CA)</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.en_GB" title="English (GB)" hreflang="en_GB" rel="alternate" lang="en_GB">English (GB)</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.es" title="Castellano" hreflang="es" rel="alternate" lang="es">Castellano</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.es_AR" title="Spanish (AR)" hreflang="es_AR" rel="alternate" lang="es_AR">Castellano (AR)</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.es_CL" title="Spanish (CL)" hreflang="es_CL" rel="alternate" lang="es_CL">Español (CL)</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.es_MX" title="Spanish (MX)" hreflang="es_MX" rel="alternate" lang="es_MX">Castellano (MX)</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.eu" title="Euskara" hreflang="eu" rel="alternate" lang="eu">Euskara</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.fi" title="Suomeksi" hreflang="fi" rel="alternate" lang="fi">Suomeksi</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.fr" title="français" hreflang="fr" rel="alternate" lang="fr">français</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.fr_CA" title="French (CA)" hreflang="fr_CA" rel="alternate" lang="fr_CA">français (CA)</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.gl" title="Galego" hreflang="gl" rel="alternate" lang="gl">Galego</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.he" title="עברית" hreflang="he" rel="alternate" lang="he">עברית</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.hr" title="hrvatski" hreflang="hr" rel="alternate" lang="hr">hrvatski</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.hu" title="Magyar" hreflang="hu" rel="alternate" lang="hu">Magyar</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.it" title="Italiano" hreflang="it" rel="alternate" lang="it">Italiano</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.ja" title="日本語" hreflang="ja" rel="alternate" lang="ja">日本語</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.ko" title="한국어" hreflang="ko" rel="alternate" lang="ko">한국어</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.ms" title="Melayu" hreflang="ms" rel="alternate" lang="ms">Melayu</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.nl" title="Nederlands" hreflang="nl" rel="alternate" lang="nl">Nederlands</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.pl" title="polski" hreflang="pl" rel="alternate" lang="pl">polski</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.pt" title="Português" hreflang="pt" rel="alternate" lang="pt">Português</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.pt_PT" hreflang="pt_PT" rel="alternate" lang="pt_PT">Português (PT)</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.se" title="svenska" hreflang="se" rel="alternate" lang="se">svenska</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.sl" title="slovenski jezik" hreflang="sl" rel="alternate" lang="sl">slovenski jezik</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.zh" title="简体中文" hreflang="zh" rel="alternate" lang="zh">简体中文</a>
<a href="http://creativecommons.org/licenses/by-sa/2.5/deed.zh_TW" title="Chinese (Taiwan)" hreflang="zh_TW" rel="alternate" lang="zh_TW">華語 (台灣)</a>
</div></div>
<div id="deed">
<div align="center">
<img src="deed_files/logo_deed.gif" alt="Creative Commons Deed" border="0" height="79" vspace="14" width="280">
<p><b>Attribution-ShareAlike 2.5 </b></p>
<div class="text">
<p><strong>You are free:</strong></p>
<ul>
<li>to copy, distribute, display, and perform the work</li>
<li>to make derivative works</li>
<li>to make commercial use of the work</li>
</ul>
<p><strong>Under the following conditions:</strong></p>
<div align="center"><table class="draft" border="0" cellpadding="4" cellspacing="0" width="500">
<tbody>
<tr>
<td>
<img src="deed_files/deed.gif" alt="by" align="left" border="0" hspace="4">
</td>
<td align="left">
<div class="tiny"><strong>Attribution</strong>.
You must attribute the work in the manner specified by the author or licensor.</div>
</td>
</tr>
<tr>
<td>
<img src="deed_files/deed_002.gif" alt="sa" align="left" border="0" hspace="4">
</td>
<td align="left">
<div class="tiny"><strong>Share Alike</strong>.
If you alter, transform, or build upon this work, you may distribute
the resulting work only under a license identical to this one.</div>
</td>
</tr>
</tbody></table></div>
<ul>
<li>For any reuse or distribution, you must make clear to others the license terms of this work.</li>
<li>Any of these conditions can be waived if you get permission from the copyright holder.</li>
</ul>
<p style="margin-top: 40px;" align="center"><strong>Your fair use and other rights are in no way affected by the above.</strong></p>
<p align="center">
This is a human-readable summary of the <a href="http://creativecommons.org/licenses/by-sa/2.5/legalcode" class="fulltext">Legal Code (the full license)</a>.
</p>
<div align="center">
<a href="http://creativecommons.org/licenses/disclaimer-popup?lang=en" onclick="window.open('/licenses/disclaimer-popup?lang=en', 'characteristic_help', 'width=375,height=300,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=yes,menubar=no,status=yes'); return false;">Disclaimer</a>
<a href="http://creativecommons.org/licenses/disclaimer-popup?lang=en" onclick="window.open('/licenses/disclaimer-popup?lang=en', 'characteristic_help', 'width=375,height=300,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=yes,menubar=no,status=yes'); return false;"><img src="deed_files/popup.gif" alt="disclaimer" border="0" height="13" width="15"></a></div>
<p>&nbsp;</p>
</div>
</div>
</div>
<p>
<a href="http://creativecommons.org/about/licenses">Learn how to distribute your work using this license</a>
</p>
</body></html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

View File

@ -0,0 +1,54 @@
body {
margin: 0px;
padding: 0px;
font-family: verdana, arial, helvetica, sans-serif;
color: black;
background-color: white;
text-align: center;
font-size:11px;
/* part 1 of 2 centering hack */
}
#deed {
width: 620px;
padding: 15px;
margin-top: 20px;
margin-bottom: 20px;
margin-right: auto;
margin-left: auto;
/* opera does not like 'margin:20px auto' */
background: #ffc;
border: 3px groove #333;
text-align:left;
/* part 2 of 2 centering hack */
width: 620px; /* ie5win fudge begins */
voice-family: "\"}\"";
voice-family:inherit;
width: 584px;
}
html>body #content {
width: 584px; /* ie5win fudge ends */
}
.fineprint {
border:1px solid black;
padding:8px;
background:#ffffff;
text-align:justify;
}
.text, li {
font-family:verdana, sans-serif;
font-size:11px;
margin-left:20px;
margin-right:20px;
line-height:140%;
text-align:left;
}
.tiny {
font-family:verdana, sans-serif;
font-size:11px;
margin-bottom:10px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 B

View File

@ -0,0 +1,378 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html><head><title>Creative Commons Legal Code</title>
<link rel="stylesheet" type="text/css" href="legalcode_files/deeds.css">
<style type="text/css">
li {
margin-bottom:12px;
}
</style></head><body>
<p align="center"><a href="http://creativecommons.org/">Creative Commons</a></p>
<div id="deed">
<div align="center"><img src="legalcode_files/logo_code.gif" alt="Creative Commons Legal Code" border="0" height="79" vspace="14" width="280"></div>
<p align="center"><b>Attribution-ShareAlike 2.5</b></p>
<div class="text">
<div class="fineprint" style="background: transparent none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL
SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON
AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE
INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
ITS USE.</div>
<p><em>License</em> </p>
<p>THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS
CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS
PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK
OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS
PROHIBITED. </p>
<p>BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND
AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU
THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH
TERMS AND CONDITIONS. </p>
<p><strong>1. Definitions</strong> </p>
<ol type="a">
<li>
<strong>"Collective Work"</strong> means a work, such as a periodical
issue, anthology or encyclopedia, in which the Work in its entirety in
unmodified form, along with a number of other contributions,
constituting separate and independent works in themselves, are
assembled into a collective whole. A work that constitutes a Collective
Work will not be considered a Derivative Work (as defined below) for
the purposes of this License.
</li>
<li>
<strong>"Derivative Work"</strong> means a work based upon the Work or
upon the Work and other pre-existing works, such as a translation,
musical arrangement, dramatization, fictionalization, motion picture
version, sound recording, art reproduction, abridgment, condensation,
or any other form in which the Work may be recast, transformed, or
adapted, except that a work that constitutes a Collective Work will not
be considered a Derivative Work for the purpose of this License. For
the avoidance of doubt, where the Work is a musical composition or
sound recording, the synchronization of the Work in timed-relation with
a moving image ("synching") will be considered a Derivative Work for
the purpose of this License.
</li>
<li>
<strong>"Licensor"</strong> means the individual or entity that offers the Work under the terms of this License.
</li>
<li>
<strong>"Original Author"</strong> means the individual or entity who created the Work.
</li>
<li>
<strong>"Work"</strong> means the copyrightable work of authorship offered under the terms of this License.
</li>
<li>
<strong>"You"</strong> means an individual or entity exercising rights
under this License who has not previously violated the terms of this
License with respect to the Work, or who has received express
permission from the Licensor to exercise rights under this License
despite a previous violation.
</li>
<li><strong>"License Elements"</strong> means the following high-level
license attributes as selected by Licensor and indicated in the title
of this License: Attribution, ShareAlike.</li></ol>
<p><strong>2. Fair Use Rights.</strong> Nothing in this license is
intended to reduce, limit, or restrict any rights arising from fair
use, first sale or other limitations on the exclusive rights of the
copyright owner under copyright law or other applicable laws. </p>
<p><strong>3. License Grant.</strong> Subject to the terms and
conditions of this License, Licensor hereby grants You a worldwide,
royalty-free, non-exclusive, perpetual (for the duration of the
applicable copyright) license to exercise the rights in the Work as
stated below: </p>
<ol type="a">
<li>
to reproduce the Work, to incorporate the Work into one or more
Collective Works, and to reproduce the Work as incorporated in the
Collective Works;
</li>
<li>
to create and reproduce Derivative Works;
</li>
<li>to distribute copies or phonorecords of, display publicly, perform
publicly, and perform publicly by means of a digital audio transmission
the Work including as incorporated in Collective Works;
</li>
<li>to distribute copies or phonorecords of, display publicly, perform
publicly, and perform publicly by means of a digital audio transmission
Derivative Works.
</li>
<li><p>For the avoidance of doubt, where the work is a musical composition:</p>
<ol type="i">
<li><strong>Performance Royalties Under Blanket Licenses</strong>.
Licensor waives the exclusive right to collect, whether individually or
via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties
for the public performance or public digital performance (e.g. webcast)
of the Work.</li>
<li><strong>Mechanical Rights and Statutory Royalties</strong>.
Licensor waives the exclusive right to collect, whether individually or
via a music rights society or designated agent (e.g. Harry Fox Agency),
royalties for any phonorecord You create from the Work ("cover
version") and distribute, subject to the compulsory license created by
17 USC Section 115 of the US Copyright Act (or the equivalent in other
jurisdictions).
</li>
</ol>
</li>
<li><strong>Webcasting Rights and Statutory Royalties</strong>. For the
avoidance of doubt, where the Work is a sound recording, Licensor
waives the exclusive right to collect, whether individually or via a
performance-rights society (e.g. SoundExchange), royalties for the
public digital performance (e.g. webcast) of the Work, subject to the
compulsory license created by 17 USC Section 114 of the US Copyright
Act (or the equivalent in other jurisdictions).</li>
</ol>
<p>The above rights may be exercised in all media and formats whether
now known or hereafter devised. The above rights include the right to
make such modifications as are technically necessary to exercise the
rights in other media and formats. All rights not expressly granted by
Licensor are hereby reserved.</p>
<p><strong>4. Restrictions.</strong>The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: </p>
<ol type="a">
<li>
You may distribute, publicly display, publicly perform, or publicly
digitally perform the Work only under the terms of this License, and
You must include a copy of, or the Uniform Resource Identifier for,
this License with every copy or phonorecord of the Work You distribute,
publicly display, publicly perform, or publicly digitally perform. You
may not offer or impose any terms on the Work that alter or restrict
the terms of this License or the recipients' exercise of the rights
granted hereunder. You may not sublicense the Work. You must keep
intact all notices that refer to this License and to the disclaimer of
warranties. You may not distribute, publicly display, publicly perform,
or publicly digitally perform the Work with any technological measures
that control access or use of the Work in a manner inconsistent with
the terms of this License Agreement. The above applies to the Work as
incorporated in a Collective Work, but this does not require the
Collective Work apart from the Work itself to be made subject to the
terms of this License. If You create a Collective Work, upon notice
from any Licensor You must, to the extent practicable, remove from the
Collective Work any credit as required by clause 4(c), as requested. If
You create a Derivative Work, upon notice from any Licensor You must,
to the extent practicable, remove from the Derivative Work any credit
as required by clause 4(c), as requested.
</li>
<li>You may distribute, publicly display, publicly perform, or publicly
digitally perform a Derivative Work only under the terms of this
License, a later version of this License with the same License Elements
as this License, or a Creative Commons iCommons license that contains
the same License Elements as this License (e.g. Attribution-ShareAlike
2.5 Japan). You must include a copy of, or the Uniform Resource
Identifier for, this License or other license specified in the previous
sentence with every copy or phonorecord of each Derivative Work You
distribute, publicly display, publicly perform, or publicly digitally
perform. You may not offer or impose any terms on the Derivative Works
that alter or restrict the terms of this License or the recipients'
exercise of the rights granted hereunder, and You must keep intact all
notices that refer to this License and to the disclaimer of warranties.
You may not distribute, publicly display, publicly perform, or publicly
digitally perform the Derivative Work with any technological measures
that control access or use of the Work in a manner inconsistent with
the terms of this License Agreement. The above applies to the
Derivative Work as incorporated in a Collective Work, but this does not
require the Collective Work apart from the Derivative Work itself to be
made subject to the terms of this License.
</li>
<li>If you distribute, publicly display, publicly perform, or publicly
digitally perform the Work or any Derivative Works or Collective Works,
You must keep intact all copyright notices for the Work and provide,
reasonable to the medium or means You are utilizing: (i) the name of
the Original Author (or pseudonym, if applicable) if supplied, and/or
(ii) if the Original Author and/or Licensor designate another party or
parties (e.g. a sponsor institute, publishing entity, journal) for
attribution in Licensor's copyright notice, terms of service or by
other reasonable means, the name of such party or parties; the title of
the Work if supplied; to the extent reasonably practicable, the Uniform
Resource Identifier, if any, that Licensor specifies to be associated
with the Work, unless such URI does not refer to the copyright notice
or licensing information for the Work; and in the case of a Derivative
Work, a credit identifying the use of the Work in the Derivative Work
(e.g., "French translation of the Work by Original Author," or
"Screenplay based on original Work by Original Author"). Such credit
may be implemented in any reasonable manner; provided, however, that in
the case of a Derivative Work or Collective Work, at a minimum such
credit will appear where any other comparable authorship credit appears
and in a manner at least as prominent as such other comparable
authorship credit.
</li>
</ol>
<p><strong>5. Representations, Warranties and Disclaimer</strong></p>
<p>UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR
OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR
OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE,
MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR
THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF
ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO
NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY
NOT APPLY TO YOU.</p>
<p><strong>6. Limitation on Liability.</strong> EXCEPT TO THE EXTENT
REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU
ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL,
PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF
THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES. </p>
<p><strong>7. Termination</strong> </p>
<ol type="a">
<li>
This License and the rights granted hereunder will terminate
automatically upon any breach by You of the terms of this License.
Individuals or entities who have received Derivative Works or
Collective Works from You under this License, however, will not have
their licenses terminated provided such individuals or entities remain
in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8
will survive any termination of this License.
</li>
<li>Subject to the above terms and conditions, the license granted here
is perpetual (for the duration of the applicable copyright in the
Work). Notwithstanding the above, Licensor reserves the right to
release the Work under different license terms or to stop distributing
the Work at any time; provided, however that any such election will not
serve to withdraw this License (or any other license that has been, or
is required to be, granted under the terms of this License), and this
License will continue in full force and effect unless terminated as
stated above.
</li>
</ol>
<p><strong>8. Miscellaneous</strong> </p>
<ol type="a">
<li>Each time You distribute or publicly digitally perform the Work or
a Collective Work, the Licensor offers to the recipient a license to
the Work on the same terms and conditions as the license granted to You
under this License.
</li>
<li>Each time You distribute or publicly digitally perform a Derivative
Work, Licensor offers to the recipient a license to the original Work
on the same terms and conditions as the license granted to You under
this License.
</li>
<li>If any provision of this License is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability of
the remainder of the terms of this License, and without further action
by the parties to this agreement, such provision shall be reformed to
the minimum extent necessary to make such provision valid and
enforceable.
</li>
<li>No term or provision of this License shall be deemed waived and no
breach consented to unless such waiver or consent shall be in writing
and signed by the party to be charged with such waiver or consent.
</li>
<li>This License constitutes the entire agreement between the parties
with respect to the Work licensed here. There are no understandings,
agreements or representations with respect to the Work not specified
here. Licensor shall not be bound by any additional provisions that may
appear in any communication from You. This License may not be modified
without the mutual written agreement of the Licensor and You.
</li>
</ol>
<!-- BREAKOUT FOR CC NOTICE. NOT A PART OF THE LICENSE -->
<div class="fineprint">
<p>Creative Commons is not a party to this License, and makes no
warranty whatsoever in connection with the Work. Creative Commons will
not be liable to You or any party on any legal theory for any damages
whatsoever, including without limitation any general, special,
incidental or consequential damages arising in connection to this
license. Notwithstanding the foregoing two (2) sentences, if Creative
Commons has expressly identified itself as the Licensor hereunder, it
shall have all rights and obligations of Licensor. </p>
<p>Except for the limited purpose of indicating to the public that the
Work is licensed under the CCPL, neither party will use the trademark
"Creative Commons" or any related trademark or logo of Creative Commons
without the prior written consent of Creative Commons. Any permitted
use will be in compliance with Creative Commons' then-current trademark
usage guidelines, as may be published on its website or otherwise made
available upon request from time to time.</p>
<p>Creative Commons may be contacted at <a href="http://creativecommons.org/">http://creativecommons.org/</a>.</p>
</div>
<!-- END CC NOTICE -->
</div>
<div style="margin-bottom: 10px;" align="right"><a href="http://creativecommons.org/licenses/by-sa/2.5/" class="fulltext">« Back to Commons Deed</a></div>
</div>
</body></html>

View File

@ -0,0 +1,54 @@
body {
margin: 0px;
padding: 0px;
font-family: verdana, arial, helvetica, sans-serif;
color: black;
background-color: white;
text-align: center;
font-size:11px;
/* part 1 of 2 centering hack */
}
#deed {
width: 620px;
padding: 15px;
margin-top: 20px;
margin-bottom: 20px;
margin-right: auto;
margin-left: auto;
/* opera does not like 'margin:20px auto' */
background: #ffc;
border: 3px groove #333;
text-align:left;
/* part 2 of 2 centering hack */
width: 620px; /* ie5win fudge begins */
voice-family: "\"}\"";
voice-family:inherit;
width: 584px;
}
html>body #content {
width: 584px; /* ie5win fudge ends */
}
.fineprint {
border:1px solid black;
padding:8px;
background:#ffffff;
text-align:justify;
}
.text, li {
font-family:verdana, sans-serif;
font-size:11px;
margin-left:20px;
margin-right:20px;
line-height:140%;
text-align:left;
}
.tiny {
font-family:verdana, sans-serif;
font-size:11px;
margin-bottom:10px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -0,0 +1,12 @@
diff -dur ELFkickers.orig/sstrip/Makefile ELFkickers/sstrip/Makefile
--- ELFkickers.orig/sstrip/Makefile 2001-03-24 12:58:27.000000000 +0100
+++ ELFkickers/sstrip/Makefile 2007-05-31 21:17:18.000000000 +0200
@@ -1,7 +1,7 @@
# Makefile for sstrip
sstrip: sstrip.c
- gcc -ggdb -Wall -W -o sstrip sstrip.c
+ $(CC) -Wall -W -o sstrip sstrip.c
clean:
rm -f sstrip

View File

@ -0,0 +1,23 @@
Signed-off-by: dank@kegel.com
Raising the size of the hash table is a noticable win when linking
at least one large app.
There was a patch,
http://sources.redhat.com/ml/binutils/2004-06/msg00165.html
to do this dynamically. No idea why that didn't make it in.
So this tiny change to raise the default size is just
a stopgap for now.
--- binutils-2.16.1/bfd/hash.c.old 2006-03-02 23:01:39.000000000 -0800
+++ binutils-2.16.1/bfd/hash.c 2006-03-02 23:01:58.000000000 -0800
@@ -300,7 +300,7 @@
*/
/* The default number of entries to use when creating a hash table. */
-#define DEFAULT_SIZE 4051
+#define DEFAULT_SIZE 32749
static size_t bfd_default_hash_table_size = DEFAULT_SIZE;
/* Create a new hash table, given a number of entries. */

View File

@ -0,0 +1,40 @@
Make psignal prototype in libiberty match that in glibc.
Fixes:
gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
/usr/include/signal.h:131: prototype declaration
gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
/usr/include/signal.h:131: prototype declaration
gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
mprotect... make[1]: *** [strsignal.o] Error 1
make[1]: Leaving directory `/export/hda3/dkegel/queue/jobdir.produser_cpsm17/crosstool-0.32/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.1.3/build-binutils/libiberty'
make: *** [all-libiberty] Error 2
when building on red hat 7.1
though it's a bit of a mystery why libiberty's psignal is being compiled at
all, since red hat 7.1's glibc supports psignal (hence the error message)
--- binutils-2.15/libiberty/strsignal.c.old 2005-04-18 13:57:40.000000000 -0700
+++ binutils-2.15/libiberty/strsignal.c 2005-04-18 13:59:09.000000000 -0700
@@ -544,7 +544,7 @@
/*
-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
+@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
Print @var{message} to the standard error, followed by a colon,
followed by the description of the signal specified by @var{signo},
@@ -557,9 +557,7 @@
#ifndef HAVE_PSIGNAL
void
-psignal (signo, message)
- unsigned signo;
- char *message;
+psignal (int signo, const char *message)
{
if (signal_names == NULL)
{

View File

@ -0,0 +1,95 @@
[removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank]
Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
Fixes
localealias.s:544: Error: junk at end of line, first unrecognized character is `,'
when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
Paths adjusted to match crosstool's patcher.
Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
From: Andreas Schwab <schwab at suse dot de>
To: Nathan Sidwell <nathan at codesourcery dot com>
Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
Date: Fri, 23 Apr 2004 22:27:19 +0200
Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
Nathan Sidwell <nathan@codesourcery.com> writes:
> Index: read.c
> ===================================================================
> RCS file: /cvs/src/src/gas/read.c,v
> retrieving revision 1.76
> diff -c -3 -p -r1.76 read.c
> *** read.c 12 Mar 2004 17:48:12 -0000 1.76
> --- read.c 18 Mar 2004 09:56:05 -0000
> *************** read_a_source_file (char *name)
> *** 1053,1059 ****
> #endif
> input_line_pointer--;
> /* Report unknown char as ignored. */
> ! ignore_rest_of_line ();
> }
>
> #ifdef md_after_pass_hook
> --- 1053,1059 ----
> #endif
> input_line_pointer--;
> /* Report unknown char as ignored. */
> ! demand_empty_rest_of_line ();
> }
>
> #ifdef md_after_pass_hook
This means that the unknown character is no longer ignored, despite the
comment. As a side effect a line starting with a line comment character
not followed by APP in NO_APP mode now triggers an error instead of just a
warning, breaking builds of glibc on m68k-linux. Earlier in
read_a_source_file where #APP is handled there is another comment that
claims that unknown comments are ignored, when in fact they aren't (only
the initial line comment character is skipped).
Note that the presence of #APP will mess up the line counters, but
that appears to be difficult to fix.
Andreas.
2004-04-23 Andreas Schwab <schwab@suse.de>
* read.c (read_a_source_file): Ignore unknown text after line
comment character. Fix misleading comment.
--- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200
+++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200
@@ -950,10 +950,14 @@ read_a_source_file (char *name)
unsigned int new_length;
char *tmp_buf = 0;
- bump_line_counters ();
s = input_line_pointer;
if (strncmp (s, "APP\n", 4))
- continue; /* We ignore it */
+ {
+ /* We ignore it */
+ ignore_rest_of_line ();
+ continue;
+ }
+ bump_line_counters ();
s += 4;
sb_new (&sbuf);
@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
continue;
#endif
input_line_pointer--;
- /* Report unknown char as ignored. */
+ /* Report unknown char as error. */
demand_empty_rest_of_line ();
}
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."

View File

@ -0,0 +1,693 @@
Signed-off-by: dank@kegel.com
Fixes ld speed issue.
See http://weblogs.mozillazine.org/roc/archives/2005/02/optimizing_gnu.html
See thread "Re: optimizations for 3x speedup in ld",
http://sources.redhat.com/ml/binutils/2005-03/msg00847.html
Wildcard section matching enhancement, backported from the binutils CVS tree.
Here's the CVS log comment from the original change to ldlang.c:
revision 1.177
date: 2005/04/06 15:33:02; author: jakub; state: Exp; lines: +438 -51
2005-04-06 Jakub Jelinek <jakub@redhat.com>
* ldlang.c: Formatting.
(walk_wild_consider_section): Remember return value from wildcardp.
(is_simple_wild): Use strcspn instead of 2 strpbrk calls and strlen.
(wild_spec_can_overlap): Use strcspn instead of strpbrk and strlen.
2005-04-06 Robert O'Callahan <rocallahan@novell.com>
* ld.h (lean_section_userdata_type): Remove.
(fat_section_userdata_type): Remove file field.
(SECTION_USERDATA_SIZE): Remove.
* ldlang.c (init_os): Eliminate initialization of unused
lean_section_userdata_type.
* ldlang.h (callback_t, walk_wild_section_handler_t): New
typedefs.
(struct lang_wild_statement_struct): Add walk_wild_section_handler
and handler_data fields.
* ldlang.c (callback_t): Removed.
(walk_wild_consider_section, walk_wild_section_general,
section_iterator_callback, find_section, is_simple_wild,
match_simple_wild, walk_wild_section_specs1_wild0,
walk_wild_section_specs1_wild1, walk_wild_section_specs2_wild1,
walk_wild_section_specs3_wild2, walk_wild_section_specs4_wild2,
wild_spec_can_overlap, analyze_walk_wild_section_handler): New
functions.
(lang_add_wild): Call analyze_walk_wild_section_handler.
(walk_wild_section): Renamed to walk_wild_section_general and
created a wrapper function.
(section_iterator_callback_data): New typedef.
Index: src/ld/ld.h
===================================================================
RCS file: /cvs/src/src/ld/ld.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- binutils/ld/ld.h.old 16 Mar 2005 21:52:42 -0000 1.26
+++ binutils/ld/ld.h 6 Apr 2005 15:33:02 -0000 1.27
@@ -1,6 +1,6 @@
/* ld.h -- general linker header file
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004
+ 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
@@ -89,28 +89,15 @@
struct map_symbol_def *next;
};
-/* Extra information we hold on sections */
-typedef struct lean_user_section_struct {
- /* For output sections: pointer to the section where this data will go. */
- struct lang_input_statement_struct *file;
-} lean_section_userdata_type;
-
/* The initial part of fat_user_section_struct has to be idential with
lean_user_section_struct. */
typedef struct fat_user_section_struct {
- /* For output sections: pointer to the section where this data will go. */
- struct lang_input_statement_struct *file;
/* For input sections, when writing a map file: head / tail of a linked
list of hash table entries for symbols defined in this section. */
struct map_symbol_def *map_symbol_def_head;
struct map_symbol_def **map_symbol_def_tail;
} fat_section_userdata_type;
-#define SECTION_USERDATA_SIZE \
- (command_line.reduce_memory_overheads \
- ? sizeof (lean_section_userdata_type) \
- : sizeof (fat_section_userdata_type))
-
#define get_userdata(x) ((x)->userdata)
#define BYTE_SIZE (1)
Index: src/ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -r1.176 -r1.177
--- binutils/ld/ldlang.c.old 18 Mar 2005 13:56:26 -0000 1.176
+++ binutils/ld/ldlang.c 6 Apr 2005 15:33:02 -0000 1.177
@@ -84,9 +84,6 @@
static void lang_record_phdrs (void);
static void lang_do_version_exports_section (void);
-typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
- asection *, lang_input_statement_type *, void *);
-
/* Exported variables. */
lang_output_section_statement_type *abs_output_section;
lang_statement_list_type lang_output_section_statement;
@@ -155,21 +152,71 @@
/* Generic traversal routines for finding matching sections. */
+/* Try processing a section against a wildcard. This just calls
+ the callback unless the filename exclusion list is present
+ and excludes the file. It's hardly ever present so this
+ function is very fast. */
+
+static void
+walk_wild_consider_section (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ asection *s,
+ struct wildcard_list *sec,
+ callback_t callback,
+ void *data)
+{
+ bfd_boolean skip = FALSE;
+ struct name_list *list_tmp;
+
+ /* Don't process sections from files which were
+ excluded. */
+ for (list_tmp = sec->spec.exclude_name_list;
+ list_tmp;
+ list_tmp = list_tmp->next)
+ {
+ bfd_boolean is_wildcard = wildcardp (list_tmp->name);
+ if (is_wildcard)
+ skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
+ else
+ skip = strcmp (list_tmp->name, file->filename) == 0;
+
+ /* If this file is part of an archive, and the archive is
+ excluded, exclude this file. */
+ if (! skip && file->the_bfd != NULL
+ && file->the_bfd->my_archive != NULL
+ && file->the_bfd->my_archive->filename != NULL)
+ {
+ if (is_wildcard)
+ skip = fnmatch (list_tmp->name,
+ file->the_bfd->my_archive->filename,
+ 0) == 0;
+ else
+ skip = strcmp (list_tmp->name,
+ file->the_bfd->my_archive->filename) == 0;
+ }
+
+ if (skip)
+ break;
+ }
+
+ if (!skip)
+ (*callback) (ptr, sec, s, file, data);
+}
+
+/* Lowest common denominator routine that can handle everything correctly,
+ but slowly. */
+
static void
-walk_wild_section (lang_wild_statement_type *ptr,
- lang_input_statement_type *file,
- callback_t callback,
- void *data)
+walk_wild_section_general (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ callback_t callback,
+ void *data)
{
asection *s;
-
- if (file->just_syms_flag)
- return;
+ struct wildcard_list *sec;
for (s = file->the_bfd->sections; s != NULL; s = s->next)
{
- struct wildcard_list *sec;
-
sec = ptr->section_list;
if (sec == NULL)
(*callback) (ptr, sec, s, file, data);
@@ -177,39 +224,8 @@
while (sec != NULL)
{
bfd_boolean skip = FALSE;
- struct name_list *list_tmp;
- /* Don't process sections from files which were
- excluded. */
- for (list_tmp = sec->spec.exclude_name_list;
- list_tmp;
- list_tmp = list_tmp->next)
- {
- if (wildcardp (list_tmp->name))
- skip = fnmatch (list_tmp->name, file->filename, 0) == 0;
- else
- skip = strcmp (list_tmp->name, file->filename) == 0;
-
- /* If this file is part of an archive, and the archive is
- excluded, exclude this file. */
- if (! skip && file->the_bfd != NULL
- && file->the_bfd->my_archive != NULL
- && file->the_bfd->my_archive->filename != NULL)
- {
- if (wildcardp (list_tmp->name))
- skip = fnmatch (list_tmp->name,
- file->the_bfd->my_archive->filename,
- 0) == 0;
- else
- skip = strcmp (list_tmp->name,
- file->the_bfd->my_archive->filename) == 0;
- }
-
- if (skip)
- break;
- }
-
- if (!skip && sec->spec.name != NULL)
+ if (sec->spec.name != NULL)
{
const char *sname = bfd_get_section_name (file->the_bfd, s);
@@ -220,13 +236,381 @@
}
if (!skip)
- (*callback) (ptr, sec, s, file, data);
+ walk_wild_consider_section (ptr, file, s, sec, callback, data);
sec = sec->next;
}
}
}
+/* Routines to find a single section given its name. If there's more
+ than one section with that name, we report that. */
+
+typedef struct
+{
+ asection *found_section;
+ bfd_boolean multiple_sections_found;
+} section_iterator_callback_data;
+
+static bfd_boolean
+section_iterator_callback (bfd *bfd ATTRIBUTE_UNUSED, asection *s, void *data)
+{
+ section_iterator_callback_data *d = data;
+
+ if (d->found_section != NULL)
+ {
+ d->multiple_sections_found = TRUE;
+ return TRUE;
+ }
+
+ d->found_section = s;
+ return FALSE;
+}
+
+static asection *
+find_section (lang_input_statement_type *file,
+ struct wildcard_list *sec,
+ bfd_boolean *multiple_sections_found)
+{
+ section_iterator_callback_data cb_data = { NULL, FALSE };
+
+ bfd_get_section_by_name_if (file->the_bfd, sec->spec.name,
+ section_iterator_callback, &cb_data);
+ *multiple_sections_found = cb_data.multiple_sections_found;
+ return cb_data.found_section;
+}
+
+/* Code for handling simple wildcards without going through fnmatch,
+ which can be expensive because of charset translations etc. */
+
+/* A simple wild is a literal string followed by a single '*',
+ where the literal part is at least 4 characters long. */
+
+static bfd_boolean
+is_simple_wild (const char *name)
+{
+ size_t len = strcspn (name, "*?[");
+ return len >= 4 && name[len] == '*' && name[len + 1] == '\0';
+}
+
+static bfd_boolean
+match_simple_wild (const char *pattern, const char *name)
+{
+ /* The first four characters of the pattern are guaranteed valid
+ non-wildcard characters. So we can go faster. */
+ if (pattern[0] != name[0] || pattern[1] != name[1]
+ || pattern[2] != name[2] || pattern[3] != name[3])
+ return FALSE;
+
+ pattern += 4;
+ name += 4;
+ while (*pattern != '*')
+ if (*name++ != *pattern++)
+ return FALSE;
+
+ return TRUE;
+}
+
+/* Specialized, optimized routines for handling different kinds of
+ wildcards */
+
+static void
+walk_wild_section_specs1_wild0 (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ callback_t callback,
+ void *data)
+{
+ /* We can just do a hash lookup for the section with the right name.
+ But if that lookup discovers more than one section with the name
+ (should be rare), we fall back to the general algorithm because
+ we would otherwise have to sort the sections to make sure they
+ get processed in the bfd's order. */
+ bfd_boolean multiple_sections_found;
+ struct wildcard_list *sec0 = ptr->handler_data[0];
+ asection *s0 = find_section (file, sec0, &multiple_sections_found);
+
+ if (multiple_sections_found)
+ walk_wild_section_general (ptr, file, callback, data);
+ else if (s0)
+ walk_wild_consider_section (ptr, file, s0, sec0, callback, data);
+}
+
+static void
+walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ callback_t callback,
+ void *data)
+{
+ asection *s;
+ struct wildcard_list *wildsec0 = ptr->handler_data[0];
+
+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
+ {
+ const char *sname = bfd_get_section_name (file->the_bfd, s);
+ bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname);
+
+ if (!skip)
+ walk_wild_consider_section (ptr, file, s, wildsec0, callback, data);
+ }
+}
+
+static void
+walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ callback_t callback,
+ void *data)
+{
+ asection *s;
+ struct wildcard_list *sec0 = ptr->handler_data[0];
+ struct wildcard_list *wildsec1 = ptr->handler_data[1];
+ bfd_boolean multiple_sections_found;
+ asection *s0 = find_section (file, sec0, &multiple_sections_found);
+
+ if (multiple_sections_found)
+ {
+ walk_wild_section_general (ptr, file, callback, data);
+ return;
+ }
+
+ /* Note that if the section was not found, s0 is NULL and
+ we'll simply never succeed the s == s0 test below. */
+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
+ {
+ /* Recall that in this code path, a section cannot satisfy more
+ than one spec, so if s == s0 then it cannot match
+ wildspec1. */
+ if (s == s0)
+ walk_wild_consider_section (ptr, file, s, sec0, callback, data);
+ else
+ {
+ const char *sname = bfd_get_section_name (file->the_bfd, s);
+ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
+
+ if (!skip)
+ walk_wild_consider_section (ptr, file, s, wildsec1, callback,
+ data);
+ }
+ }
+}
+
+static void
+walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ callback_t callback,
+ void *data)
+{
+ asection *s;
+ struct wildcard_list *sec0 = ptr->handler_data[0];
+ struct wildcard_list *wildsec1 = ptr->handler_data[1];
+ struct wildcard_list *wildsec2 = ptr->handler_data[2];
+ bfd_boolean multiple_sections_found;
+ asection *s0 = find_section (file, sec0, &multiple_sections_found);
+
+ if (multiple_sections_found)
+ {
+ walk_wild_section_general (ptr, file, callback, data);
+ return;
+ }
+
+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
+ {
+ if (s == s0)
+ walk_wild_consider_section (ptr, file, s, sec0, callback, data);
+ else
+ {
+ const char *sname = bfd_get_section_name (file->the_bfd, s);
+ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
+
+ if (!skip)
+ walk_wild_consider_section (ptr, file, s, wildsec1, callback, data);
+ else
+ {
+ skip = !match_simple_wild (wildsec2->spec.name, sname);
+ if (!skip)
+ walk_wild_consider_section (ptr, file, s, wildsec2, callback,
+ data);
+ }
+ }
+ }
+}
+
+static void
+walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ callback_t callback,
+ void *data)
+{
+ asection *s;
+ struct wildcard_list *sec0 = ptr->handler_data[0];
+ struct wildcard_list *sec1 = ptr->handler_data[1];
+ struct wildcard_list *wildsec2 = ptr->handler_data[2];
+ struct wildcard_list *wildsec3 = ptr->handler_data[3];
+ bfd_boolean multiple_sections_found;
+ asection *s0 = find_section (file, sec0, &multiple_sections_found), *s1;
+
+ if (multiple_sections_found)
+ {
+ walk_wild_section_general (ptr, file, callback, data);
+ return;
+ }
+
+ s1 = find_section (file, sec1, &multiple_sections_found);
+ if (multiple_sections_found)
+ {
+ walk_wild_section_general (ptr, file, callback, data);
+ return;
+ }
+
+ for (s = file->the_bfd->sections; s != NULL; s = s->next)
+ {
+ if (s == s0)
+ walk_wild_consider_section (ptr, file, s, sec0, callback, data);
+ else
+ if (s == s1)
+ walk_wild_consider_section (ptr, file, s, sec1, callback, data);
+ else
+ {
+ const char *sname = bfd_get_section_name (file->the_bfd, s);
+ bfd_boolean skip = !match_simple_wild (wildsec2->spec.name,
+ sname);
+
+ if (!skip)
+ walk_wild_consider_section (ptr, file, s, wildsec2, callback,
+ data);
+ else
+ {
+ skip = !match_simple_wild (wildsec3->spec.name, sname);
+ if (!skip)
+ walk_wild_consider_section (ptr, file, s, wildsec3,
+ callback, data);
+ }
+ }
+ }
+}
+
+static void
+walk_wild_section (lang_wild_statement_type *ptr,
+ lang_input_statement_type *file,
+ callback_t callback,
+ void *data)
+{
+ if (file->just_syms_flag)
+ return;
+
+ (*ptr->walk_wild_section_handler) (ptr, file, callback, data);
+}
+
+/* Returns TRUE when name1 is a wildcard spec that might match
+ something name2 can match. We're conservative: we return FALSE
+ only if the prefixes of name1 and name2 are different up to the
+ first wildcard character. */
+
+static bfd_boolean
+wild_spec_can_overlap (const char *name1, const char *name2)
+{
+ size_t prefix1_len = strcspn (name1, "?*[");
+ size_t prefix2_len = strcspn (name2, "?*[");
+ size_t min_prefix_len;
+
+ /* Note that if there is no wildcard character, then we treat the
+ terminating 0 as part of the prefix. Thus ".text" won't match
+ ".text." or ".text.*", for example. */
+ if (name1[prefix1_len] == '\0')
+ prefix1_len++;
+ if (name2[prefix2_len] == '\0')
+ prefix2_len++;
+
+ min_prefix_len = prefix1_len < prefix2_len ? prefix1_len : prefix2_len;
+
+ return memcmp (name1, name2, min_prefix_len) == 0;
+}
+
+/* Select specialized code to handle various kinds of wildcard
+ statements. */
+
+static void
+analyze_walk_wild_section_handler (lang_wild_statement_type *ptr)
+{
+ int sec_count = 0;
+ int wild_name_count = 0;
+ struct wildcard_list *sec;
+ int signature;
+ int data_counter;
+
+ ptr->walk_wild_section_handler = walk_wild_section_general;
+
+ /* Count how many wildcard_specs there are, and how many of those
+ actually use wildcards in the name. Also, bail out if any of the
+ wildcard names are NULL. (Can this actually happen?
+ walk_wild_section used to test for it.) And bail out if any
+ of the wildcards are more complex than a simple string
+ ending in a single '*'. */
+ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
+ {
+ ++sec_count;
+ if (sec->spec.name == NULL)
+ return;
+ if (wildcardp (sec->spec.name))
+ {
+ ++wild_name_count;
+ if (!is_simple_wild (sec->spec.name))
+ return;
+ }
+ }
+
+ /* The zero-spec case would be easy to optimize but it doesn't
+ happen in practice. Likewise, more than 4 specs doesn't
+ happen in practice. */
+ if (sec_count == 0 || sec_count > 4)
+ return;
+
+ /* Check that no two specs can match the same section. */
+ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
+ {
+ struct wildcard_list *sec2;
+ for (sec2 = sec->next; sec2 != NULL; sec2 = sec2->next)
+ {
+ if (wild_spec_can_overlap (sec->spec.name, sec2->spec.name))
+ return;
+ }
+ }
+
+ signature = (sec_count << 8) + wild_name_count;
+ switch (signature)
+ {
+ case 0x0100:
+ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild0;
+ break;
+ case 0x0101:
+ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild1;
+ break;
+ case 0x0201:
+ ptr->walk_wild_section_handler = walk_wild_section_specs2_wild1;
+ break;
+ case 0x0302:
+ ptr->walk_wild_section_handler = walk_wild_section_specs3_wild2;
+ break;
+ case 0x0402:
+ ptr->walk_wild_section_handler = walk_wild_section_specs4_wild2;
+ break;
+ default:
+ return;
+ }
+
+ /* Now fill the data array with pointers to the specs, first the
+ specs with non-wildcard names, then the specs with wildcard
+ names. It's OK to process the specs in different order from the
+ given order, because we've already determined that no section
+ will match more than one spec. */
+ data_counter = 0;
+ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
+ if (!wildcardp (sec->spec.name))
+ ptr->handler_data[data_counter++] = sec;
+ for (sec = ptr->section_list; sec != NULL; sec = sec->next)
+ if (wildcardp (sec->spec.name))
+ ptr->handler_data[data_counter++] = sec;
+}
+
/* Handle a wild statement for a single file F. */
static void
@@ -1175,17 +1559,12 @@
static void
init_os (lang_output_section_statement_type *s)
{
- lean_section_userdata_type *new;
-
if (s->bfd_section != NULL)
return;
if (strcmp (s->name, DISCARD_SECTION_NAME) == 0)
einfo (_("%P%F: Illegal use of `%s' section\n"), DISCARD_SECTION_NAME);
- new = stat_alloc (SECTION_USERDATA_SIZE);
- memset (new, 0, SECTION_USERDATA_SIZE);
-
s->bfd_section = bfd_get_section_by_name (output_bfd, s->name);
if (s->bfd_section == NULL)
s->bfd_section = bfd_make_section (output_bfd, s->name);
@@ -1199,7 +1578,14 @@
/* We initialize an output sections output offset to minus its own
vma to allow us to output a section through itself. */
s->bfd_section->output_offset = 0;
- get_userdata (s->bfd_section) = new;
+ if (!command_line.reduce_memory_overheads)
+ {
+ fat_section_userdata_type *new
+ = stat_alloc (sizeof (fat_section_userdata_type));
+ memset (new, 0, sizeof (fat_section_userdata_type));
+ get_userdata (s->bfd_section) = new;
+ }
+
/* If there is a base address, make sure that any sections it might
mention are initialized. */
@@ -4939,6 +5325,7 @@
new->section_list = section_list;
new->keep_sections = keep_sections;
lang_list_init (&new->children);
+ analyze_walk_wild_section_handler (new);
}
void
Index: src/ld/ldlang.h
===================================================================
RCS file: /cvs/src/src/ld/ldlang.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- binutils/ld/ldlang.h.old 3 Mar 2005 11:51:58 -0000 1.44
+++ binutils/ld/ldlang.h 6 Apr 2005 15:33:03 -0000 1.45
@@ -298,7 +298,17 @@
union lang_statement_union *file;
} lang_afile_asection_pair_statement_type;
-typedef struct lang_wild_statement_struct
+typedef struct lang_wild_statement_struct lang_wild_statement_type;
+
+typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *,
+ asection *, lang_input_statement_type *, void *);
+
+typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *,
+ lang_input_statement_type *,
+ callback_t callback,
+ void *data);
+
+struct lang_wild_statement_struct
{
lang_statement_header_type header;
const char *filename;
@@ -306,7 +316,10 @@
struct wildcard_list *section_list;
bfd_boolean keep_sections;
lang_statement_list_type children;
-} lang_wild_statement_type;
+
+ walk_wild_section_handler_t walk_wild_section_handler;
+ struct wildcard_list *handler_data[4];
+};
typedef struct lang_address_statement_struct
{

View File

@ -0,0 +1,22 @@
--- binutils-2.15/configure.old 2004-07-21 21:36:47.000000000 -0700
+++ binutils-2.15/configure 2004-07-21 21:37:08.000000000 -0700
@@ -999,7 +999,7 @@
# Some tools are only suitable for building in a "native" situation.
# Remove these if host!=target.
-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
+native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
# Similarly, some are only suitable for cross toolchains.
# Remove these if host=target.
--- binutils-2.15/configure.in.old 2004-07-21 21:37:19.000000000 -0700
+++ binutils-2.15/configure.in 2004-07-21 21:37:34.000000000 -0700
@@ -236,7 +236,7 @@
# Some tools are only suitable for building in a "native" situation.
# Remove these if host!=target.
-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
+native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
# Similarly, some are only suitable for cross toolchains.
# Remove these if host=target.

View File

@ -0,0 +1,28 @@
Signed-off-by: dank@kegel.com
See http://sourceware.org/ml/binutils/2005-12/msg00270.html
http://sourceware.org/ml/binutils-cvs/2005-12/msg00139.html
STABS hash table size change, backported from the binutils CVS tree. Here's
the CVS log comment for the original change:
revision 1.25
date: 2005/12/29 10:29:23; author: nickc; state: Exp; lines: +2 -3
(_bfd_link_section_stabs): Use bfd_hash_table_init rather than
bfd_hash_table_init_n(...,251) so that the size of the hash table can be
controlled by the user.
--- binutils/bfd/stabs.c.old 4 May 2005 15:53:39 -0000 1.24
+++ binutils/bfd/stabs.c 29 Dec 2005 10:29:23 -0000 1.25
@@ -194,9 +194,8 @@
goto error_return;
/* Make sure the first byte is zero. */
(void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE);
- if (! bfd_hash_table_init_n (&sinfo->includes,
- stab_link_includes_newfunc,
- 251))
+ if (! bfd_hash_table_init (&sinfo->includes,
+ stab_link_includes_newfunc))
goto error_return;
sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr");
if (sinfo->stabstr == NULL)

View File

@ -0,0 +1,40 @@
diff -durN binutils-2.16.1.orig/gas/config/tc-i386.c binutils-2.16.1/gas/config/tc-i386.c
--- binutils-2.16.1.orig/gas/config/tc-i386.c 2005-04-13 19:58:42.000000000 +0200
+++ binutils-2.16.1/gas/config/tc-i386.c 2008-09-22 09:00:09.000000000 +0200
@@ -192,16 +192,10 @@
#endif
;
-#if (defined (TE_I386AIX) \
- || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) \
- && !defined (TE_LINUX) \
- && !defined (TE_NETWARE) \
- && !defined (TE_FreeBSD) \
- && !defined (TE_NetBSD)))
/* This array holds the chars that always start a comment. If the
pre-processor is disabled, these aren't very useful. */
-const char comment_chars[] = "#/";
-#define PREFIX_SEPARATOR '\\'
+const char comment_chars[] = "#";
+#define PREFIX_SEPARATOR '/'
/* This array holds the chars that only start a comment at the beginning of
a line. If the line seems to have the form '# 123 filename'
@@ -211,16 +205,7 @@
#NO_APP at the beginning of its output.
Also note that comments started like this one will always work if
'/' isn't otherwise defined. */
-const char line_comment_chars[] = "#";
-
-#else
-/* Putting '/' here makes it impossible to use the divide operator.
- However, we need it for compatibility with SVR4 systems. */
-const char comment_chars[] = "#";
-#define PREFIX_SEPARATOR '/'
-
-const char line_comment_chars[] = "/#";
-#endif
+const char line_comment_chars[] = "#/";
const char line_separator_chars[] = ";";

View File

@ -0,0 +1,149 @@
diff -dur binutils-2.17.old/bfd/configure binutils-2.17/bfd/configure
--- binutils-2.17.old/bfd/configure 2006-06-23 20:17:03.000000000 +0200
+++ binutils-2.17/bfd/configure 2007-05-01 18:26:03.000000000 +0200
@@ -3576,7 +3576,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux-gnu*|linux-uclibc*)
lt_cv_deplibs_check_method=pass_all
;;
diff -dur binutils-2.17.old/binutils/configure binutils-2.17/binutils/configure
--- binutils-2.17.old/binutils/configure 2006-04-06 23:49:29.000000000 +0200
+++ binutils-2.17/binutils/configure 2007-05-01 18:26:03.000000000 +0200
@@ -3411,7 +3411,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux-gnu*|linux-uclibc*)
lt_cv_deplibs_check_method=pass_all
;;
diff -dur binutils-2.17.old/configure binutils-2.17/configure
--- binutils-2.17.old/configure 2006-04-06 23:49:25.000000000 +0200
+++ binutils-2.17/configure 2007-05-01 18:26:03.000000000 +0200
@@ -1276,7 +1276,7 @@
am33_2.0-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
- sh-*-linux*)
+ sh*-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
sh*-*-pe|mips*-*-pe|*arm-wince-pe)
@@ -1584,7 +1584,7 @@
romp-*-*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
;;
- sh-*-* | sh64-*-*)
+ sh*-*-* | sh64-*-*)
case "${host}" in
i[3456789]86-*-vsta) ;; # don't add gprof back in
i[3456789]86-*-go32*) ;; # don't add gprof back in
diff -dur binutils-2.17.old/configure.in binutils-2.17/configure.in
--- binutils-2.17.old/configure.in 2006-06-23 20:19:53.000000000 +0200
+++ binutils-2.17/configure.in 2007-05-01 18:26:03.000000000 +0200
@@ -468,7 +468,7 @@
am33_2.0-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
- sh-*-linux*)
+ sh*-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
sh*-*-pe|mips*-*-pe|*arm-wince-pe)
@@ -776,7 +776,7 @@
romp-*-*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
;;
- sh-*-* | sh64-*-*)
+ sh*-*-* | sh64-*-*)
case "${host}" in
i[[3456789]]86-*-vsta) ;; # don't add gprof back in
i[[3456789]]86-*-go32*) ;; # don't add gprof back in
diff -dur binutils-2.17.old/gas/configure binutils-2.17/gas/configure
--- binutils-2.17.old/gas/configure 2006-04-06 23:49:31.000000000 +0200
+++ binutils-2.17/gas/configure 2007-05-01 18:26:03.000000000 +0200
@@ -3411,7 +3411,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux-gnu*|linux-uclibc*)
lt_cv_deplibs_check_method=pass_all
;;
diff -dur binutils-2.17.old/gprof/configure binutils-2.17/gprof/configure
--- binutils-2.17.old/gprof/configure 2006-04-06 23:49:33.000000000 +0200
+++ binutils-2.17/gprof/configure 2007-05-01 18:26:03.000000000 +0200
@@ -3414,6 +3414,11 @@
lt_cv_deplibs_check_method=pass_all
;;
+linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+ ;;
+
netbsd* | knetbsd*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff -dur binutils-2.17.old/ld/configure binutils-2.17/ld/configure
--- binutils-2.17.old/ld/configure 2006-04-11 12:36:26.000000000 +0200
+++ binutils-2.17/ld/configure 2007-05-01 18:26:03.000000000 +0200
@@ -3413,7 +3413,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux-gnu*|linux-uclibc*)
lt_cv_deplibs_check_method=pass_all
;;
diff -dur binutils-2.17.old/libtool.m4 binutils-2.17/libtool.m4
--- binutils-2.17.old/libtool.m4 2005-12-27 17:37:57.000000000 +0100
+++ binutils-2.17/libtool.m4 2007-05-01 18:26:03.000000000 +0200
@@ -739,7 +739,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux-gnu*|linux-uclibc*)
lt_cv_deplibs_check_method=pass_all
;;
diff -dur binutils-2.17.old/ltconfig binutils-2.17/ltconfig
--- binutils-2.17.old/ltconfig 2005-07-16 04:36:38.000000000 +0200
+++ binutils-2.17/ltconfig 2007-05-01 18:26:03.000000000 +0200
@@ -602,6 +602,7 @@
# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
case $host_os in
+linux-uclibc*) ;;
linux-gnu*) ;;
linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
esac
@@ -1247,7 +1248,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux-gnu*|linux-uclibc*)
version_type=linux
need_lib_prefix=no
need_version=no
diff -dur binutils-2.17.old/opcodes/configure binutils-2.17/opcodes/configure
--- binutils-2.17.old/opcodes/configure 2006-02-17 15:36:28.000000000 +0100
+++ binutils-2.17/opcodes/configure 2007-05-01 18:26:03.000000000 +0200
@@ -3579,7 +3579,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux-gnu*|linux-uclibc*)
lt_cv_deplibs_check_method=pass_all
;;

View File

@ -0,0 +1,24 @@
diff -dur binutils-2.17.old/configure binutils-2.17/configure
--- binutils-2.17.old/configure 2007-05-01 18:26:03.000000000 +0200
+++ binutils-2.17/configure 2007-05-01 18:26:06.000000000 +0200
@@ -1305,7 +1305,7 @@
arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
;;
- arm*-*-linux-gnueabi)
+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
noconfigdirs="$noconfigdirs target-libjava target-libobjc"
;;
diff -dur binutils-2.17.old/configure.in binutils-2.17/configure.in
--- binutils-2.17.old/configure.in 2007-05-01 18:26:03.000000000 +0200
+++ binutils-2.17/configure.in 2007-05-01 18:26:06.000000000 +0200
@@ -497,7 +497,7 @@
arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
;;
- arm*-*-linux-gnueabi)
+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
noconfigdirs="$noconfigdirs target-libjava target-libobjc"
;;

View File

@ -0,0 +1,16 @@
diff -u binutils-2.18-orig/configure binutils-2.18/configure
--- binutils-2.18-orig/configure 2007-08-06 16:29:40.000000000 -0400
+++ binutils-2.18/configure 2007-09-27 22:41:51.000000000 -0400
@@ -6125,10 +6125,10 @@
*" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
*)
- # For an installed makeinfo, we require it to be from texinfo 4.4 or
+ # For an installed makeinfo, we require it to be from texinfo 4.6 or
# higher, else we use the "missing" dummy.
if ${MAKEINFO} --version \
- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
+ | egrep 'texinfo[^0-9]*(4\.([6-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
:
else
MAKEINFO="$MISSING makeinfo"

View File

@ -0,0 +1,24 @@
diff -dur binutils-2.17.old/ld/Makefile.am binutils-2.17/ld/Makefile.am
--- binutils-2.17.old/ld/Makefile.am 2006-06-03 06:45:50.000000000 +0200
+++ binutils-2.17/ld/Makefile.am 2007-05-01 18:26:09.000000000 +0200
@@ -20,7 +20,7 @@
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
EMUL = @EMUL@
EMULATION_OFILES = @EMULATION_OFILES@
diff -dur binutils-2.17.old/ld/Makefile.in binutils-2.17/ld/Makefile.in
--- binutils-2.17.old/ld/Makefile.in 2006-06-03 06:45:50.000000000 +0200
+++ binutils-2.17/ld/Makefile.in 2007-05-01 18:26:09.000000000 +0200
@@ -269,7 +269,7 @@
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
BASEDIR = $(srcdir)/..
BFDDIR = $(BASEDIR)/bfd
INCDIR = $(BASEDIR)/include

View File

@ -0,0 +1,17 @@
diff -dur binutils-2.17.old/bfd/opncls.c binutils-2.17/bfd/opncls.c
--- binutils-2.17.old/bfd/opncls.c 2006-03-16 13:20:16.000000000 +0100
+++ binutils-2.17/bfd/opncls.c 2007-05-01 18:26:11.000000000 +0200
@@ -158,6 +158,13 @@
{
bfd *nbfd;
const bfd_target *target_vec;
+ struct stat s;
+
+ if (stat (filename, &s) == 0)
+ if (S_ISDIR(s.st_mode)) {
+ bfd_set_error (bfd_error_file_not_recognized);
+ return NULL;
+ }
nbfd = _bfd_new_bfd ();
if (nbfd == NULL)

View File

@ -0,0 +1,21 @@
diff -dur binutils-2.17.old/ld/emultempl/elf32.em binutils-2.17/ld/emultempl/elf32.em
--- binutils-2.17.old/ld/emultempl/elf32.em 2006-06-12 15:05:04.000000000 +0200
+++ binutils-2.17/ld/emultempl/elf32.em 2007-05-01 18:26:13.000000000 +0200
@@ -970,6 +970,8 @@
&& command_line.rpath == NULL)
{
lib_path = (const char *) getenv ("LD_RUN_PATH");
+ if ((lib_path) && (strlen (lib_path) == 0))
+ lib_path = NULL;
if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
force))
break;
@@ -1154,6 +1156,8 @@
rpath = command_line.rpath;
if (rpath == NULL)
rpath = (const char *) getenv ("LD_RUN_PATH");
+ if ((rpath) && (strlen (rpath) == 0))
+ rpath = NULL;
if (! (bfd_elf_size_dynamic_sections
(output_bfd, command_line.soname, rpath,
command_line.filter_shlib,

View File

@ -0,0 +1,28 @@
diff -dur binutils-2.17.old/bfd/elf32-mips.c binutils-2.17/bfd/elf32-mips.c
--- binutils-2.17.old/bfd/elf32-mips.c 2006-03-22 10:28:13.000000000 +0100
+++ binutils-2.17/bfd/elf32-mips.c 2007-05-01 18:26:15.000000000 +0200
@@ -1617,7 +1617,9 @@
/* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
page sizes of up to that limit, so we need to respect it. */
-#define ELF_MAXPAGESIZE 0x10000
+/*#define ELF_MAXPAGESIZE 0x10000*/
+/* Use 4K to shrink the elf header. NOT for general use! */
+#define ELF_MAXPAGESIZE 0x1000
#define elf32_bed elf32_tradbed
/* Include the target file again for this target. */
diff -dur binutils-2.17.old/bfd/elfn32-mips.c binutils-2.17/bfd/elfn32-mips.c
--- binutils-2.17.old/bfd/elfn32-mips.c 2005-11-23 15:04:17.000000000 +0100
+++ binutils-2.17/bfd/elfn32-mips.c 2007-05-01 18:26:15.000000000 +0200
@@ -2402,7 +2402,9 @@
/* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
page sizes of up to that limit, so we need to respect it. */
-#define ELF_MAXPAGESIZE 0x10000
+/*#define ELF_MAXPAGESIZE 0x10000*/
+/* Use 4K to shrink the elf header. NOT for general use! */
+#define ELF_MAXPAGESIZE 0x1000
#define elf32_bed elf32_tradbed
/* Include the target file again for this target. */

View File

@ -0,0 +1,23 @@
Signed-off-by: dank@kegel.com
Raising the size of the hash table is a noticable win when linking
at least one large app.
There was a patch,
http://sources.redhat.com/ml/binutils/2004-06/msg00165.html
to do this dynamically. No idea why that didn't make it in.
So this tiny change to raise the default size is just
a stopgap for now.
--- binutils-2.17/bfd/hash.c.old 2006-03-02 23:01:39.000000000 -0800
+++ binutils-2.17/bfd/hash.c 2006-03-02 23:01:58.000000000 -0800
@@ -298,7 +298,7 @@
*/
/* The default number of entries to use when creating a hash table. */
-#define DEFAULT_SIZE 4051
+#define DEFAULT_SIZE 32749
static size_t bfd_default_hash_table_size = DEFAULT_SIZE;
/* Create a new hash table, given a number of entries. */

View File

@ -0,0 +1,29 @@
Make psignal prototype in libiberty match that in glibc.
Fixes:
gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal':
gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype
/usr/include/signal.h:131: prototype declaration
gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype
/usr/include/signal.h:131: prototype declaration
gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned
mprotect... make[1]: *** [strsignal.o] Error 1
make[1]: Leaving directory `/export/hda3/dkegel/queue/jobdir.produser_cpsm17/crosstool-0.32/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.1.3/build-binutils/libiberty'
make: *** [all-libiberty] Error 2
when building on red hat 7.1
though it's a bit of a mystery why libiberty's psignal is being compiled at
all, since red hat 7.1's glibc supports psignal (hence the error message)
--- binutils-2.17/libiberty/strsignal.c.old 2005-04-18 13:57:40.000000000 -0700
+++ binutils-2.17/libiberty/strsignal.c 2005-04-18 13:59:09.000000000 -0700
@@ -536,7 +536,7 @@
/*
-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message})
+@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message})
Print @var{message} to the standard error, followed by a colon,
followed by the description of the signal specified by @var{signo},

View File

@ -0,0 +1,95 @@
[removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank]
Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
Fixes
localealias.s:544: Error: junk at end of line, first unrecognized character is `,'
when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
Paths adjusted to match crosstool's patcher.
Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
From: Andreas Schwab <schwab at suse dot de>
To: Nathan Sidwell <nathan at codesourcery dot com>
Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
Date: Fri, 23 Apr 2004 22:27:19 +0200
Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
Nathan Sidwell <nathan@codesourcery.com> writes:
> Index: read.c
> ===================================================================
> RCS file: /cvs/src/src/gas/read.c,v
> retrieving revision 1.76
> diff -c -3 -p -r1.76 read.c
> *** read.c 12 Mar 2004 17:48:12 -0000 1.76
> --- read.c 18 Mar 2004 09:56:05 -0000
> *************** read_a_source_file (char *name)
> *** 1053,1059 ****
> #endif
> input_line_pointer--;
> /* Report unknown char as ignored. */
> ! ignore_rest_of_line ();
> }
>
> #ifdef md_after_pass_hook
> --- 1053,1059 ----
> #endif
> input_line_pointer--;
> /* Report unknown char as ignored. */
> ! demand_empty_rest_of_line ();
> }
>
> #ifdef md_after_pass_hook
This means that the unknown character is no longer ignored, despite the
comment. As a side effect a line starting with a line comment character
not followed by APP in NO_APP mode now triggers an error instead of just a
warning, breaking builds of glibc on m68k-linux. Earlier in
read_a_source_file where #APP is handled there is another comment that
claims that unknown comments are ignored, when in fact they aren't (only
the initial line comment character is skipped).
Note that the presence of #APP will mess up the line counters, but
that appears to be difficult to fix.
Andreas.
2004-04-23 Andreas Schwab <schwab@suse.de>
* read.c (read_a_source_file): Ignore unknown text after line
comment character. Fix misleading comment.
--- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200
+++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200
@@ -1008,10 +1008,14 @@ read_a_source_file (char *name)
unsigned int new_length;
char *tmp_buf = 0;
- bump_line_counters ();
s = input_line_pointer;
if (strncmp (s, "APP\n", 4))
- continue; /* We ignore it */
+ {
+ /* We ignore it */
+ ignore_rest_of_line ();
+ continue;
+ }
+ bump_line_counters ();
s += 4;
sb_new (&sbuf);
@@ -1110,7 +1110,7 @@ read_a_source_file (char *name)
continue;
#endif
input_line_pointer--;
- /* Report unknown char as ignored. */
+ /* Report unknown char as error. */
demand_empty_rest_of_line ();
}
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."

View File

@ -0,0 +1,22 @@
--- binutils-2.17/configure.old 2004-07-21 21:36:47.000000000 -0700
+++ binutils-2.17/configure 2004-07-21 21:37:08.000000000 -0700
@@ -1022,7 +1022,7 @@
# Some tools are only suitable for building in a "native" situation.
# Remove these if host!=target.
-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
+native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
# Similarly, some are only suitable for cross toolchains.
# Remove these if host=target.
--- binutils-2.17/configure.in.old 2004-07-21 21:37:19.000000000 -0700
+++ binutils-2.17/configure.in 2004-07-21 21:37:34.000000000 -0700
@@ -227,7 +227,7 @@
# Some tools are only suitable for building in a "native" situation.
# Remove these if host!=target.
-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
+native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
# Similarly, some are only suitable for cross toolchains.
# Remove these if host=target.

View File

@ -0,0 +1,64 @@
diff -durN binutils-2.17.orig/gas/config/tc-i386.c binutils-2.17/gas/config/tc-i386.c
--- binutils-2.17.orig/gas/config/tc-i386.c 2006-04-07 08:40:57.000000000 +0200
+++ binutils-2.17/gas/config/tc-i386.c 2008-09-22 09:06:07.000000000 +0200
@@ -196,24 +196,10 @@
#endif
;
-#if (defined (TE_I386AIX) \
- || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) \
- && !defined (TE_GNU) \
- && !defined (TE_LINUX) \
- && !defined (TE_NETWARE) \
- && !defined (TE_FreeBSD) \
- && !defined (TE_NetBSD)))
/* This array holds the chars that always start a comment. If the
- pre-processor is disabled, these aren't very useful. The option
- --divide will remove '/' from this list. */
-const char *i386_comment_chars = "#/";
-#define SVR4_COMMENT_CHARS 1
-#define PREFIX_SEPARATOR '\\'
-
-#else
+ pre-processor is disabled, these aren't very useful. */
const char *i386_comment_chars = "#";
#define PREFIX_SEPARATOR '/'
-#endif
/* This array holds the chars that only start a comment at the beginning of
a line. If the line seems to have the form '# 123 filename'
@@ -5486,20 +5472,6 @@
break;
case OPTION_DIVIDE:
-#ifdef SVR4_COMMENT_CHARS
- {
- char *n, *t;
- const char *s;
-
- n = (char *) xmalloc (strlen (i386_comment_chars) + 1);
- t = n;
- for (s = i386_comment_chars; *s != '\0'; s++)
- if (*s != '/')
- *t++ = *s;
- *t = '\0';
- i386_comment_chars = n;
- }
-#endif
break;
default:
@@ -5525,13 +5497,8 @@
fprintf (stream, _("\
-s ignored\n"));
#endif
-#ifdef SVR4_COMMENT_CHARS
- fprintf (stream, _("\
- --divide do not treat `/' as a comment character\n"));
-#else
fprintf (stream, _("\
--divide ignored\n"));
-#endif
}
#if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \

View File

@ -0,0 +1,32 @@
diff -u binutils-2.18-orig/configure binutils-2.18/configure
--- binutils-2.18-orig/configure 2007-08-06 16:29:40.000000000 -0400
+++ binutils-2.18/configure 2007-09-27 22:41:51.000000000 -0400
@@ -6125,10 +6125,10 @@
*" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
*)
- # For an installed makeinfo, we require it to be from texinfo 4.4 or
+ # For an installed makeinfo, we require it to be from texinfo 4.6 or
# higher, else we use the "missing" dummy.
if ${MAKEINFO} --version \
- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
+ | egrep 'texinfo[^0-9]*(4\.([6-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
:
else
MAKEINFO="$MISSING makeinfo"
diff -u binutils-2.18-orig/configure.ac binutils-2.18/configure.ac
--- binutils-2.18-orig/configure.ac 2007-08-28 16:24:26.000000000 -0400
+++ binutils-2.18/configure.ac 2007-09-27 22:41:00.000000000 -0400
@@ -2400,10 +2400,10 @@
*" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
*)
changequote(,)
- # For an installed makeinfo, we require it to be from texinfo 4.4 or
+ # For an installed makeinfo, we require it to be from texinfo 4.6 or
# higher, else we use the "missing" dummy.
if ${MAKEINFO} --version \
- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
+ | egrep 'texinfo[^0-9]*(4\.([6-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
:
else
MAKEINFO="$MISSING makeinfo"

View File

@ -0,0 +1,20 @@
Enable using a shell other than bash.
Courtesy "Martin Guy" <martinwguy@yahoo.it>
http://sourceware.org/ml/crossgcc/2008-08/msg00037.html
--- binutils-2.18.orig/ld/genscripts.sh 2007-08-12 20:00:07.000000000 +0100
+++ binutils-2.18/ld/genscripts.sh 2008-08-25 16:09:54.000000000 +0100
@@ -398,9 +398,11 @@
. $em_script
em_script=$current_script
}
- fragment()
+
+ alias fragment='em_lineno=$LINENO; fragment_em'
+ fragment_em()
{
- local lineno=$[${BASH_LINENO[0]} + 1]
+ local lineno=$[$em_lineno + 1]
echo >> e${EMULATION_NAME}.c "#line $lineno \"$em_script\""
cat >> e${EMULATION_NAME}.c
}

View File

@ -0,0 +1,64 @@
diff -durN binutils-2.18.orig/gas/config/tc-i386.c binutils-2.18/gas/config/tc-i386.c
--- binutils-2.18.orig/gas/config/tc-i386.c 2007-08-24 16:01:22.000000000 +0200
+++ binutils-2.18/gas/config/tc-i386.c 2008-09-22 08:11:42.000000000 +0200
@@ -180,24 +180,10 @@
#endif
;
-#if (defined (TE_I386AIX) \
- || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) \
- && !defined (TE_GNU) \
- && !defined (TE_LINUX) \
- && !defined (TE_NETWARE) \
- && !defined (TE_FreeBSD) \
- && !defined (TE_NetBSD)))
/* This array holds the chars that always start a comment. If the
- pre-processor is disabled, these aren't very useful. The option
- --divide will remove '/' from this list. */
-const char *i386_comment_chars = "#/";
-#define SVR4_COMMENT_CHARS 1
-#define PREFIX_SEPARATOR '\\'
-
-#else
+ pre-processor is disabled, these aren't very useful. */
const char *i386_comment_chars = "#";
#define PREFIX_SEPARATOR '/'
-#endif
/* This array holds the chars that only start a comment at the beginning of
a line. If the line seems to have the form '# 123 filename'
@@ -6061,20 +6047,6 @@
break;
case OPTION_DIVIDE:
-#ifdef SVR4_COMMENT_CHARS
- {
- char *n, *t;
- const char *s;
-
- n = (char *) xmalloc (strlen (i386_comment_chars) + 1);
- t = n;
- for (s = i386_comment_chars; *s != '\0'; s++)
- if (*s != '/')
- *t++ = *s;
- *t = '\0';
- i386_comment_chars = n;
- }
-#endif
break;
case OPTION_MARCH:
@@ -6142,13 +6114,8 @@
fprintf (stream, _("\
--32/--64 generate 32bit/64bit code\n"));
#endif
-#ifdef SVR4_COMMENT_CHARS
- fprintf (stream, _("\
- --divide do not treat `/' as a comment character\n"));
-#else
fprintf (stream, _("\
--divide ignored\n"));
-#endif
fprintf (stream, _("\
-march=CPU/-mtune=CPU generate code/optimize for CPU, where CPU is one of:\n\
i386, i486, pentium, pentiumpro, pentium4, nocona,\n\

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/100-ppc64-pie.patch
-= BEGIN original header =-
Original patch from Gentoo:
gentoo/src/patchsets/binutils/2.19/03_all_binutils-2.15.92.0.2-ppc64-pie.patch
-= END original header =-
diff -durN binutils-2.19.1.orig/bfd/elf64-ppc.c binutils-2.19.1/bfd/elf64-ppc.c
--- binutils-2.19.1.orig/bfd/elf64-ppc.c 2008-10-09 14:18:24.000000000 +0200
+++ binutils-2.19.1/bfd/elf64-ppc.c 2009-03-08 11:56:59.000000000 +0100
@@ -11294,7 +11294,12 @@
else if (!SYMBOL_REFERENCES_LOCAL (info, &h->elf)
&& !is_opd
&& r_type != R_PPC64_TOC)
- outrel.r_info = ELF64_R_INFO (h->elf.dynindx, r_type);
+ {
+ outrel.r_info = ELF64_R_INFO (h->elf.dynindx, r_type);
+ if (h->elf.dynindx == -1
+ && h->elf.root.type == bfd_link_hash_undefweak)
+ memset (&outrel, 0, sizeof outrel);
+ }
else
{
/* This symbol is local, or marked to become local,

View File

@ -0,0 +1,22 @@
Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/110-RPATH_ENVVAR-smack.patch
-= BEGIN original header =-
Original patch from Gentoo:
gentoo/src/patchsets/binutils/2.19/08_all_binutils-RPATH_ENVVAR-smack.patch
http://sourceware.org/ml/binutils/2007-07/msg00401.html
http://sourceware.org/bugzilla/show_bug.cgi?id=4970
-= END original header =-
diff -durN binutils-2.19.1.orig/configure binutils-2.19.1/configure
--- binutils-2.19.1.orig/configure 2008-09-04 04:18:16.000000000 +0200
+++ binutils-2.19.1/configure 2009-03-08 11:57:00.000000000 +0100
@@ -5601,6 +5601,7 @@
*-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;;
*) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
esac
+RPATH_ENVVAR="cant_touch_this_nah_nah_nah"
# On systems where the dynamic library environment variable is PATH,
if test "$RPATH_ENVVAR" = PATH; then

View File

@ -0,0 +1,57 @@
Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/120-sh-targets.patch
-= BEGIN original header =-
Original patch from Gentoo:
gentoo/src/patchsets/binutils/2.19/12_all_sh-targets.patch
r10231 | lethal | 2005-05-02 09:58:00 -0400 (Mon, 02 May 2005) | 13 lines
Likewise, binutils has no idea about any of these new targets either, so we
fix that up too.. now we're able to actually build a real toolchain for
sh2a_nofpu- and other more ineptly named toolchains (and yes, there are more
inept targets than that one, really. Go look, I promise).
-= END original header =-
diff -durN binutils-2.19.1.orig/configure binutils-2.19.1/configure
--- binutils-2.19.1.orig/configure 2009-03-08 11:57:00.000000000 +0100
+++ binutils-2.19.1/configure 2009-03-08 11:57:00.000000000 +0100
@@ -2281,7 +2281,7 @@
am33_2.0-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
- sh-*-linux*)
+ sh*-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
sh*-*-pe|mips*-*-pe|*arm-wince-pe)
@@ -2606,7 +2606,7 @@
romp-*-*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
;;
- sh-*-* | sh64-*-*)
+ sh*-*-* | sh64-*-*)
case "${host}" in
i[3456789]86-*-vsta) ;; # don't add gprof back in
i[3456789]86-*-go32*) ;; # don't add gprof back in
diff -durN binutils-2.19.1.orig/configure.ac binutils-2.19.1/configure.ac
--- binutils-2.19.1.orig/configure.ac 2009-02-02 12:54:49.000000000 +0100
+++ binutils-2.19.1/configure.ac 2009-03-08 11:57:00.000000000 +0100
@@ -530,7 +530,7 @@
am33_2.0-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
- sh-*-linux*)
+ sh*-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
sh*-*-pe|mips*-*-pe|*arm-wince-pe)
@@ -855,7 +855,7 @@
romp-*-*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
;;
- sh-*-* | sh64-*-*)
+ sh*-*-* | sh64-*-*)
case "${host}" in
i[[3456789]]86-*-vsta) ;; # don't add gprof back in
i[[3456789]]86-*-go32*) ;; # don't add gprof back in

View File

@ -0,0 +1,36 @@
Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/130-check_ldrunpath_length.patch
-= BEGIN original header =-
Original patch from Gentoo:
gentoo/src/patchsets/binutils/2.19/42_all_012_check_ldrunpath_length.patch
Originaly from Debian:
## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
## DP: cases where -rpath isn't specified. (#151024)
-= END original header =-
diff -durN binutils-2.19.1.orig/ld/emultempl/elf32.em binutils-2.19.1/ld/emultempl/elf32.em
--- binutils-2.19.1.orig/ld/emultempl/elf32.em 2008-09-07 06:02:31.000000000 +0200
+++ binutils-2.19.1/ld/emultempl/elf32.em 2009-03-08 11:57:01.000000000 +0100
@@ -1219,6 +1219,8 @@
&& command_line.rpath == NULL)
{
lib_path = (const char *) getenv ("LD_RUN_PATH");
+ if ((lib_path) && (strlen (lib_path) == 0))
+ lib_path = NULL;
if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
force))
break;
@@ -1404,6 +1406,8 @@
rpath = command_line.rpath;
if (rpath == NULL)
rpath = (const char *) getenv ("LD_RUN_PATH");
+ if ((rpath) && (strlen (rpath) == 0))
+ rpath = NULL;
if (! (bfd_elf_size_dynamic_sections
(link_info.output_bfd, command_line.soname, rpath,
command_line.filter_shlib,

View File

@ -0,0 +1,254 @@
Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/140-pt-pax-flags-20081101.patch
-= BEGIN original header =-
Original patch from Gentoo:
gentoo/src/patchsets/binutils/2.19/63_all_binutils-2.19-pt-pax-flags-20081101.patch
-= END original header =-
diff -durN binutils-2.19.1.orig/bfd/elf-bfd.h binutils-2.19.1/bfd/elf-bfd.h
--- binutils-2.19.1.orig/bfd/elf-bfd.h 2008-08-21 01:28:58.000000000 +0200
+++ binutils-2.19.1/bfd/elf-bfd.h 2009-03-08 11:57:02.000000000 +0100
@@ -1526,6 +1526,9 @@
/* Segment flags for the PT_GNU_STACK segment. */
unsigned int stack_flags;
+ /* Segment flags for the PT_PAX_FLAGS segment. */
+ unsigned int pax_flags;
+
/* Symbol version definitions in external objects. */
Elf_Internal_Verdef *verdef;
diff -durN binutils-2.19.1.orig/bfd/elf.c binutils-2.19.1/bfd/elf.c
--- binutils-2.19.1.orig/bfd/elf.c 2008-12-23 14:54:48.000000000 +0100
+++ binutils-2.19.1/bfd/elf.c 2009-03-08 11:57:02.000000000 +0100
@@ -1136,6 +1136,7 @@
case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break;
case PT_GNU_STACK: pt = "STACK"; break;
case PT_GNU_RELRO: pt = "RELRO"; break;
+ case PT_PAX_FLAGS: pt = "PAX_FLAGS"; break;
default: pt = NULL; break;
}
return pt;
@@ -2442,6 +2443,9 @@
case PT_GNU_RELRO:
return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "relro");
+ case PT_PAX_FLAGS:
+ return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "pax_flags");
+
default:
/* Check for any processor-specific program segment types. */
bed = get_elf_backend_data (abfd);
@@ -3404,6 +3408,11 @@
++segs;
}
+ {
+ /* We need a PT_PAX_FLAGS segment. */
+ ++segs;
+ }
+
for (s = abfd->sections; s != NULL; s = s->next)
{
if ((s->flags & SEC_LOAD) != 0
@@ -3983,6 +3992,20 @@
}
}
+ {
+ amt = sizeof (struct elf_segment_map);
+ m = bfd_zalloc (abfd, amt);
+ if (m == NULL)
+ goto error_return;
+ m->next = NULL;
+ m->p_type = PT_PAX_FLAGS;
+ m->p_flags = elf_tdata (abfd)->pax_flags;
+ m->p_flags_valid = 1;
+
+ *pm = m;
+ pm = &m->next;
+ }
+
free (sections);
elf_tdata (abfd)->segment_map = mfirst;
}
@@ -5160,7 +5183,8 @@
6. PT_TLS segment includes only SHF_TLS sections.
7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments.
8. PT_DYNAMIC should not contain empty sections at the beginning
- (with the possible exception of .dynamic). */
+ (with the possible exception of .dynamic).
+ 9. PT_PAX_FLAGS segments does not include any sections. */
#define IS_SECTION_IN_INPUT_SEGMENT(section, segment, bed) \
((((segment->p_paddr \
? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \
@@ -5168,6 +5192,7 @@
&& (section->flags & SEC_ALLOC) != 0) \
|| IS_NOTE (segment, section)) \
&& segment->p_type != PT_GNU_STACK \
+ && segment->p_type != PT_PAX_FLAGS \
&& (segment->p_type != PT_TLS \
|| (section->flags & SEC_THREAD_LOCAL)) \
&& (segment->p_type == PT_LOAD \
diff -durN binutils-2.19.1.orig/bfd/elflink.c binutils-2.19.1/bfd/elflink.c
--- binutils-2.19.1.orig/bfd/elflink.c 2008-08-22 10:32:39.000000000 +0200
+++ binutils-2.19.1/bfd/elflink.c 2009-03-08 11:57:02.000000000 +0100
@@ -5397,16 +5397,30 @@
return TRUE;
bed = get_elf_backend_data (output_bfd);
+ elf_tdata (output_bfd)->pax_flags = PF_NORANDEXEC;
+
+ if (info->execheap)
+ elf_tdata (output_bfd)->pax_flags |= PF_NOMPROTECT;
+ else if (info->noexecheap)
+ elf_tdata (output_bfd)->pax_flags |= PF_MPROTECT;
+
if (info->execstack)
- elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
+ {
+ elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
+ elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
+ }
else if (info->noexecstack)
- elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
+ {
+ elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
+ elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
+ }
else
{
bfd *inputobj;
asection *notesec = NULL;
int exec = 0;
+ elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
for (inputobj = info->input_bfds;
inputobj;
inputobj = inputobj->link_next)
@@ -5419,7 +5433,11 @@
if (s)
{
if (s->flags & SEC_CODE)
- exec = PF_X;
+ {
+ elf_tdata (output_bfd)->pax_flags &= ~PF_NOEMUTRAMP;
+ elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
+ exec = PF_X;
+ }
notesec = s;
}
else if (bed->default_execstack)
diff -durN binutils-2.19.1.orig/binutils/readelf.c binutils-2.19.1/binutils/readelf.c
--- binutils-2.19.1.orig/binutils/readelf.c 2008-09-17 11:00:44.000000000 +0200
+++ binutils-2.19.1/binutils/readelf.c 2009-03-08 11:57:02.000000000 +0100
@@ -2505,6 +2505,7 @@
return "GNU_EH_FRAME";
case PT_GNU_STACK: return "GNU_STACK";
case PT_GNU_RELRO: return "GNU_RELRO";
+ case PT_PAX_FLAGS: return "PAX_FLAGS";
default:
if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC))
diff -durN binutils-2.19.1.orig/include/bfdlink.h binutils-2.19.1/include/bfdlink.h
--- binutils-2.19.1.orig/include/bfdlink.h 2008-08-17 05:12:50.000000000 +0200
+++ binutils-2.19.1/include/bfdlink.h 2009-03-08 11:57:02.000000000 +0100
@@ -319,6 +319,14 @@
/* TRUE if PT_GNU_RELRO segment should be created. */
unsigned int relro: 1;
+ /* TRUE if PT_PAX_FLAGS segment should be created with PF_NOMPROTECT
+ flags. */
+ unsigned int execheap: 1;
+
+ /* TRUE if PT_PAX_FLAGS segment should be created with PF_MPROTECT
+ flags. */
+ unsigned int noexecheap: 1;
+
/* TRUE if we should warn when adding a DT_TEXTREL to a shared object. */
unsigned int warn_shared_textrel: 1;
diff -durN binutils-2.19.1.orig/include/elf/common.h binutils-2.19.1/include/elf/common.h
--- binutils-2.19.1.orig/include/elf/common.h 2008-08-04 01:20:42.000000000 +0200
+++ binutils-2.19.1/include/elf/common.h 2009-03-08 11:57:02.000000000 +0100
@@ -360,6 +360,7 @@
#define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME /* Solaris uses the same value */
#define PT_GNU_STACK (PT_LOOS + 0x474e551) /* Stack flags */
#define PT_GNU_RELRO (PT_LOOS + 0x474e552) /* Read-only after relocation */
+#define PT_PAX_FLAGS (PT_LOOS + 0x5041580) /* PaX flags */
/* Program segment permissions, in program header p_flags field. */
@@ -370,6 +371,21 @@
#define PF_MASKOS 0x0FF00000 /* New value, Oct 4, 1999 Draft */
#define PF_MASKPROC 0xF0000000 /* Processor-specific reserved bits */
+/* Flags to control PaX behavior. */
+
+#define PF_PAGEEXEC (1 << 4) /* Enable PAGEEXEC */
+#define PF_NOPAGEEXEC (1 << 5) /* Disable PAGEEXEC */
+#define PF_SEGMEXEC (1 << 6) /* Enable SEGMEXEC */
+#define PF_NOSEGMEXEC (1 << 7) /* Disable SEGMEXEC */
+#define PF_MPROTECT (1 << 8) /* Enable MPROTECT */
+#define PF_NOMPROTECT (1 << 9) /* Disable MPROTECT */
+#define PF_RANDEXEC (1 << 10) /* Enable RANDEXEC */
+#define PF_NORANDEXEC (1 << 11) /* Disable RANDEXEC */
+#define PF_EMUTRAMP (1 << 12) /* Enable EMUTRAMP */
+#define PF_NOEMUTRAMP (1 << 13) /* Disable EMUTRAMP */
+#define PF_RANDMMAP (1 << 14) /* Enable RANDMMAP */
+#define PF_NORANDMMAP (1 << 15) /* Disable RANDMMAP */
+
/* Values for section header, sh_type field. */
#define SHT_NULL 0 /* Section header table entry unused */
diff -durN binutils-2.19.1.orig/ld/emultempl/elf32.em binutils-2.19.1/ld/emultempl/elf32.em
--- binutils-2.19.1.orig/ld/emultempl/elf32.em 2009-03-08 11:57:01.000000000 +0100
+++ binutils-2.19.1/ld/emultempl/elf32.em 2009-03-08 11:57:02.000000000 +0100
@@ -2146,6 +2146,16 @@
link_info.noexecstack = TRUE;
link_info.execstack = FALSE;
}
+ else if (strcmp (optarg, "execheap") == 0)
+ {
+ link_info.execheap = TRUE;
+ link_info.noexecheap = FALSE;
+ }
+ else if (strcmp (optarg, "noexecheap") == 0)
+ {
+ link_info.noexecheap = TRUE;
+ link_info.execheap = FALSE;
+ }
EOF
if test -n "$COMMONPAGESIZE"; then
@@ -2229,6 +2239,8 @@
fprintf (file, _("\
-z execstack Mark executable as requiring executable stack\n"));
fprintf (file, _("\
+ -z execheap\t\tMark executable as requiring executable heap\n"));
+ fprintf (file, _("\
-z initfirst Mark DSO to be initialized first at runtime\n"));
fprintf (file, _("\
-z interpose Mark object to interpose all DSOs but executable\n"));
@@ -2252,6 +2264,8 @@
-z nodump Mark DSO not available to dldump\n"));
fprintf (file, _("\
-z noexecstack Mark executable as not requiring executable stack\n"));
+ fprintf (file, _("\
+ -z noexecheap\tMark executable as not requiring executable heap\n"));
EOF
if test -n "$COMMONPAGESIZE"; then
diff -durN binutils-2.19.1.orig/ld/ldgram.y binutils-2.19.1/ld/ldgram.y
--- binutils-2.19.1.orig/ld/ldgram.y 2008-07-06 15:38:36.000000000 +0200
+++ binutils-2.19.1/ld/ldgram.y 2009-03-08 11:57:02.000000000 +0100
@@ -1112,6 +1112,8 @@
$$ = exp_intop (0x6474e550);
else if (strcmp (s, "PT_GNU_STACK") == 0)
$$ = exp_intop (0x6474e551);
+ else if (strcmp (s, "PT_PAX_FLAGS") == 0)
+ $$ = exp_intop (0x65041580);
else
{
einfo (_("\

View File

@ -0,0 +1,53 @@
Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/150-warn-textrel.patch
-= BEGIN original header =-
Original patch from Gentoo:
gentoo/src/patchsets/binutils/2.19/66_all_binutils-2.18.50.0.2-warn-textrel.patch
textrels are bad for forcing copy-on-write (this affects everyone),
and for security/runtime code generation, this affects security ppl.
But in either case, it doesn't matter who needs textrels, it's
the very fact that they're needed at all.
-= END original header =-
diff -durN binutils-2.19.1.orig/bfd/elflink.c binutils-2.19.1/bfd/elflink.c
--- binutils-2.19.1.orig/bfd/elflink.c 2009-03-08 11:57:02.000000000 +0100
+++ binutils-2.19.1/bfd/elflink.c 2009-03-08 11:57:02.000000000 +0100
@@ -10820,14 +10820,12 @@
goto error_return;
/* Check for DT_TEXTREL (late, in case the backend removes it). */
- if (info->warn_shared_textrel && info->shared)
+ o = bfd_get_section_by_name (dynobj, ".dynamic");
+ if (info->warn_shared_textrel && o != NULL)
{
bfd_byte *dyncon, *dynconend;
/* Fix up .dynamic entries. */
- o = bfd_get_section_by_name (dynobj, ".dynamic");
- BFD_ASSERT (o != NULL);
-
dyncon = o->contents;
dynconend = o->contents + o->size;
for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn)
@@ -10839,7 +10837,7 @@
if (dyn.d_tag == DT_TEXTREL)
{
info->callbacks->einfo
- (_("%P: warning: creating a DT_TEXTREL in a shared object.\n"));
+ (_("%P: warning: creating a DT_TEXTREL in object.\n"));
break;
}
}
diff -durN binutils-2.19.1.orig/ld/ldmain.c binutils-2.19.1/ld/ldmain.c
--- binutils-2.19.1.orig/ld/ldmain.c 2008-08-17 05:12:50.000000000 +0200
+++ binutils-2.19.1/ld/ldmain.c 2009-03-08 11:57:02.000000000 +0100
@@ -274,6 +274,7 @@
link_info.relax_pass = 1;
link_info.pei386_auto_import = -1;
link_info.spare_dynamic_tags = 5;
+ link_info.warn_shared_textrel = TRUE;
link_info.path_separator = ':';
ldfile_add_arch ("");

View File

@ -0,0 +1,19 @@
Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/160-use-new-ld-dtags.patch
-= BEGIN original header =-
Original patch from Gentoo:
gentoo/src/patchsets/binutils/2.19/76_all_use-new-ld-dtags.patch
-= END original header =-
diff -durN binutils-2.19.1.orig/ld/ldmain.c binutils-2.19.1/ld/ldmain.c
--- binutils-2.19.1.orig/ld/ldmain.c 2009-03-08 11:57:03.000000000 +0100
+++ binutils-2.19.1/ld/ldmain.c 2009-03-08 11:57:03.000000000 +0100
@@ -262,6 +262,7 @@
link_info.allow_undefined_version = TRUE;
link_info.keep_memory = TRUE;
+ link_info.new_dtags = TRUE;
link_info.combreloc = TRUE;
link_info.strip_discarded = TRUE;
link_info.emit_hash = TRUE;

View File

@ -0,0 +1,19 @@
Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/170-use-relro.patch
-= BEGIN original header =-
Original patch from Gentoo:
gentoo/src/patchsets/binutils/2.19/78_all_use-relro.patch
-= END original header =-
diff -durN binutils-2.19.1.orig/ld/ldmain.c binutils-2.19.1/ld/ldmain.c
--- binutils-2.19.1.orig/ld/ldmain.c 2009-03-08 11:57:03.000000000 +0100
+++ binutils-2.19.1/ld/ldmain.c 2009-03-08 11:57:03.000000000 +0100
@@ -264,6 +264,7 @@
link_info.keep_memory = TRUE;
link_info.new_dtags = TRUE;
link_info.combreloc = TRUE;
+ link_info.relro = TRUE;
link_info.strip_discarded = TRUE;
link_info.emit_hash = TRUE;
link_info.callbacks = &link_callbacks;

View File

@ -0,0 +1,19 @@
Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.19/180-libiberty-pic.patch
-= BEGIN original header =-
Original patch from Gentoo:
gentoo/src/patchsets/binutils/2.19/91_all_libiberty-pic.patch
-= END original header =-
diff -durN binutils-2.19.1.orig/libiberty/Makefile.in binutils-2.19.1/libiberty/Makefile.in
--- binutils-2.19.1.orig/libiberty/Makefile.in 2008-07-24 15:51:49.000000000 +0200
+++ binutils-2.19.1/libiberty/Makefile.in 2009-03-08 11:57:03.000000000 +0100
@@ -227,6 +227,7 @@
$(AR) $(AR_FLAGS) $(TARGETLIB) \
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
$(RANLIB) $(TARGETLIB); \
+ cp $(TARGETLIB) ../ ; \
cd ..; \
else true; fi

View File

@ -0,0 +1,18 @@
--- binutils-2.20/ld/configure.tgt.orig 2010-02-20 04:05:31.000000000 -0500
+++ binutils-2.20/ld/configure.tgt 2010-02-20 04:08:11.000000000 -0500
@@ -400,11 +400,11 @@
mips*-*-vxworks*) targ_emul=elf32ebmipvxworks
targ_extra_emuls="elf32elmipvxworks" ;;
mips*-*-windiss) targ_emul=elf32mipswindiss ;;
-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+mips64*el-*-linux-*) targ_emul=elf64ltsmip
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
targ_extra_libpath=$targ_extra_emuls ;;
-mips64*-*-linux-*) targ_emul=elf32btsmipn32
- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+mips64*-*-linux-*) targ_emul=elf64btsmip
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
targ_extra_libpath=$targ_extra_emuls ;;
mips*el-*-linux-*) targ_emul=elf32ltsmip
targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"

View File

@ -0,0 +1,19 @@
diff -durN binutils-2.20.1.orig/bfd/elf64-ppc.c binutils-2.20.1/bfd/elf64-ppc.c
--- binutils-2.20.1.orig/bfd/elf64-ppc.c 2010-02-03 14:28:25.000000000 +0100
+++ binutils-2.20.1/bfd/elf64-ppc.c 2010-08-17 19:32:04.000000000 +0200
@@ -11991,7 +11991,12 @@
else if (!SYMBOL_REFERENCES_LOCAL (info, &h->elf)
&& !is_opd
&& r_type != R_PPC64_TOC)
- outrel.r_info = ELF64_R_INFO (h->elf.dynindx, r_type);
+ {
+ outrel.r_info = ELF64_R_INFO (h->elf.dynindx, r_type);
+ if (h->elf.dynindx == -1
+ && h->elf.root.type == bfd_link_hash_undefweak)
+ memset (&outrel, 0, sizeof outrel);
+ }
else
{
/* This symbol is local, or marked to become local,

View File

@ -0,0 +1,14 @@
http://sourceware.org/ml/binutils/2007-07/msg00401.html
http://sourceware.org/bugzilla/show_bug.cgi?id=4970
diff -durN binutils-2.20.1.orig/configure binutils-2.20.1/configure
--- binutils-2.20.1.orig/configure 2010-03-03 14:59:02.000000000 +0100
+++ binutils-2.20.1/configure 2010-08-17 19:32:05.000000000 +0200
@@ -6466,6 +6466,7 @@
*-*-mingw* | *-*-cygwin ) RPATH_ENVVAR=PATH ;;
*) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
esac
+RPATH_ENVVAR="cant_touch_this_nah_nah_nah"
# On systems where the dynamic library environment variable is PATH,
# gcc/ will put dynamic libraries into a subdirectory to avoid adding

View File

@ -0,0 +1,44 @@
diff -durN binutils-2.20.1.orig/configure binutils-2.20.1/configure
--- binutils-2.20.1.orig/configure 2010-08-17 19:32:05.000000000 +0200
+++ binutils-2.20.1/configure 2010-08-17 19:32:07.000000000 +0200
@@ -3054,7 +3054,7 @@
am33_2.0-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
- sh-*-linux*)
+ sh*-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
sh*-*-pe|mips*-*-pe|*arm-wince-pe)
@@ -3390,7 +3390,7 @@
romp-*-*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
;;
- sh-*-* | sh64-*-*)
+ sh*-*-* | sh64-*-*)
case "${host}" in
i[3456789]86-*-vsta) ;; # don't add gprof back in
i[3456789]86-*-go32*) ;; # don't add gprof back in
diff -durN binutils-2.20.1.orig/configure.ac binutils-2.20.1/configure.ac
--- binutils-2.20.1.orig/configure.ac 2010-03-03 15:19:08.000000000 +0100
+++ binutils-2.20.1/configure.ac 2010-08-17 19:32:07.000000000 +0200
@@ -541,7 +541,7 @@
am33_2.0-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
- sh-*-linux*)
+ sh*-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
sh*-*-pe|mips*-*-pe|*arm-wince-pe)
@@ -877,7 +877,7 @@
romp-*-*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
;;
- sh-*-* | sh64-*-*)
+ sh*-*-* | sh64-*-*)
case "${host}" in
i[[3456789]]86-*-vsta) ;; # don't add gprof back in
i[[3456789]]86-*-go32*) ;; # don't add gprof back in

View File

@ -0,0 +1,37 @@
Signed-off-by: Sven Rebhan <odinshorse@googlemail.com>
Always try to prepend the sysroot prefix to absolute filenames first.
http://bugs.gentoo.org/275666
http://sourceware.org/bugzilla/show_bug.cgi?id=10340
diff -durN binutils-2.20.1.orig/ld/ldfile.c binutils-2.20.1/ld/ldfile.c
--- binutils-2.20.1.orig/ld/ldfile.c 2009-08-30 00:11:01.000000000 +0200
+++ binutils-2.20.1/ld/ldfile.c 2010-08-17 19:32:08.000000000 +0200
@@ -308,18 +308,24 @@
directory first. */
if (! entry->is_archive)
{
- if (entry->sysrooted && IS_ABSOLUTE_PATH (entry->filename))
+ /* For absolute pathnames, try to always open the file in the
+ sysroot first. If this fails, try to open the file at the
+ given location. */
+ entry->sysrooted = is_sysrooted_pathname(entry->filename, FALSE);
+ if (IS_ABSOLUTE_PATH (entry->filename) && ld_sysroot && ! entry->sysrooted)
{
char *name = concat (ld_sysroot, entry->filename,
(const char *) NULL);
if (ldfile_try_open_bfd (name, entry))
{
entry->filename = name;
+ entry->sysrooted = TRUE;
return TRUE;
}
free (name);
}
- else if (ldfile_try_open_bfd (entry->filename, entry))
+
+ if (ldfile_try_open_bfd (entry->filename, entry))
{
entry->sysrooted = IS_ABSOLUTE_PATH (entry->filename)
&& is_sysrooted_pathname (entry->filename, TRUE);

View File

@ -0,0 +1,49 @@
#!/bin/sh -e
## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
## DP: cases where -rpath isn't specified. (#151024)
if [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
case "$1" in
-patch) patch $patch_opts -p1 < $0;;
-unpatch) patch $patch_opts -p1 -R < $0;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1;;
esac
exit 0
@DPATCH@
diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
diff -durN binutils-2.20.1.orig/ld/emultempl/elf32.em binutils-2.20.1/ld/emultempl/elf32.em
--- binutils-2.20.1.orig/ld/emultempl/elf32.em 2009-09-14 13:43:30.000000000 +0200
+++ binutils-2.20.1/ld/emultempl/elf32.em 2010-08-17 19:32:09.000000000 +0200
@@ -1233,6 +1233,8 @@
&& command_line.rpath == NULL)
{
lib_path = (const char *) getenv ("LD_RUN_PATH");
+ if ((lib_path) && (strlen (lib_path) == 0))
+ lib_path = NULL;
if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
force))
break;
@@ -1418,6 +1420,8 @@
rpath = command_line.rpath;
if (rpath == NULL)
rpath = (const char *) getenv ("LD_RUN_PATH");
+ if ((rpath) && (strlen (rpath) == 0))
+ rpath = NULL;
if (! (bfd_elf_size_dynamic_sections
(link_info.output_bfd, command_line.soname, rpath,
command_line.filter_shlib,

View File

@ -0,0 +1,248 @@
diff -durN binutils-2.20.1.orig/bfd/elf-bfd.h binutils-2.20.1/bfd/elf-bfd.h
--- binutils-2.20.1.orig/bfd/elf-bfd.h 2009-09-10 13:47:12.000000000 +0200
+++ binutils-2.20.1/bfd/elf-bfd.h 2010-08-17 19:32:11.000000000 +0200
@@ -1531,6 +1531,9 @@
/* Segment flags for the PT_GNU_STACK segment. */
unsigned int stack_flags;
+ /* Segment flags for the PT_PAX_FLAGS segment. */
+ unsigned int pax_flags;
+
/* Symbol version definitions in external objects. */
Elf_Internal_Verdef *verdef;
diff -durN binutils-2.20.1.orig/bfd/elf.c binutils-2.20.1/bfd/elf.c
--- binutils-2.20.1.orig/bfd/elf.c 2009-09-10 13:47:12.000000000 +0200
+++ binutils-2.20.1/bfd/elf.c 2010-08-17 19:32:11.000000000 +0200
@@ -1083,6 +1083,7 @@
case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break;
case PT_GNU_STACK: pt = "STACK"; break;
case PT_GNU_RELRO: pt = "RELRO"; break;
+ case PT_PAX_FLAGS: pt = "PAX_FLAGS"; break;
default: pt = NULL; break;
}
return pt;
@@ -2396,6 +2397,9 @@
case PT_GNU_RELRO:
return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "relro");
+ case PT_PAX_FLAGS:
+ return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "pax_flags");
+
default:
/* Check for any processor-specific program segment types. */
bed = get_elf_backend_data (abfd);
@@ -3413,6 +3417,11 @@
++segs;
}
+ {
+ /* We need a PT_PAX_FLAGS segment. */
+ ++segs;
+ }
+
for (s = abfd->sections; s != NULL; s = s->next)
{
if ((s->flags & SEC_LOAD) != 0
@@ -3994,6 +4003,20 @@
}
}
+ {
+ amt = sizeof (struct elf_segment_map);
+ m = bfd_zalloc (abfd, amt);
+ if (m == NULL)
+ goto error_return;
+ m->next = NULL;
+ m->p_type = PT_PAX_FLAGS;
+ m->p_flags = elf_tdata (abfd)->pax_flags;
+ m->p_flags_valid = 1;
+
+ *pm = m;
+ pm = &m->next;
+ }
+
free (sections);
elf_tdata (abfd)->segment_map = mfirst;
}
@@ -5198,7 +5221,8 @@
6. PT_TLS segment includes only SHF_TLS sections.
7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments.
8. PT_DYNAMIC should not contain empty sections at the beginning
- (with the possible exception of .dynamic). */
+ (with the possible exception of .dynamic).
+ 9. PT_PAX_FLAGS segments do not include any sections. */
#define IS_SECTION_IN_INPUT_SEGMENT(section, segment, bed) \
((((segment->p_paddr \
? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \
@@ -5206,6 +5230,7 @@
&& (section->flags & SEC_ALLOC) != 0) \
|| IS_NOTE (segment, section)) \
&& segment->p_type != PT_GNU_STACK \
+ && segment->p_type != PT_PAX_FLAGS \
&& (segment->p_type != PT_TLS \
|| (section->flags & SEC_THREAD_LOCAL)) \
&& (segment->p_type == PT_LOAD \
diff -durN binutils-2.20.1.orig/bfd/elflink.c binutils-2.20.1/bfd/elflink.c
--- binutils-2.20.1.orig/bfd/elflink.c 2009-09-10 13:47:12.000000000 +0200
+++ binutils-2.20.1/bfd/elflink.c 2010-08-17 19:32:11.000000000 +0200
@@ -5469,16 +5469,30 @@
return TRUE;
bed = get_elf_backend_data (output_bfd);
+
+ elf_tdata (output_bfd)->pax_flags = PF_NORANDEXEC;
+ if (info->execheap)
+ elf_tdata (output_bfd)->pax_flags |= PF_NOMPROTECT;
+ else if (info->noexecheap)
+ elf_tdata (output_bfd)->pax_flags |= PF_MPROTECT;
+
if (info->execstack)
- elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
+ {
+ elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
+ elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
+ }
else if (info->noexecstack)
- elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
+ {
+ elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
+ elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
+ }
else
{
bfd *inputobj;
asection *notesec = NULL;
int exec = 0;
+ elf_tdata (output_bfd)->pax_flags |= PF_NOEMUTRAMP;
for (inputobj = info->input_bfds;
inputobj;
inputobj = inputobj->link_next)
@@ -5491,7 +5505,11 @@
if (s)
{
if (s->flags & SEC_CODE)
- exec = PF_X;
+ {
+ elf_tdata (output_bfd)->pax_flags &= ~PF_NOEMUTRAMP;
+ elf_tdata (output_bfd)->pax_flags |= PF_EMUTRAMP;
+ exec = PF_X;
+ }
notesec = s;
}
else if (bed->default_execstack)
diff -durN binutils-2.20.1.orig/binutils/readelf.c binutils-2.20.1/binutils/readelf.c
--- binutils-2.20.1.orig/binutils/readelf.c 2010-01-14 11:48:23.000000000 +0100
+++ binutils-2.20.1/binutils/readelf.c 2010-08-17 19:32:11.000000000 +0200
@@ -2569,6 +2569,7 @@
return "GNU_EH_FRAME";
case PT_GNU_STACK: return "GNU_STACK";
case PT_GNU_RELRO: return "GNU_RELRO";
+ case PT_PAX_FLAGS: return "PAX_FLAGS";
default:
if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC))
diff -durN binutils-2.20.1.orig/include/bfdlink.h binutils-2.20.1/include/bfdlink.h
--- binutils-2.20.1.orig/include/bfdlink.h 2009-09-10 13:47:30.000000000 +0200
+++ binutils-2.20.1/include/bfdlink.h 2010-08-17 19:32:11.000000000 +0200
@@ -321,6 +321,14 @@
/* TRUE if PT_GNU_RELRO segment should be created. */
unsigned int relro: 1;
+ /* TRUE if PT_PAX_FLAGS segment should be created with PF_NOMPROTECT
+ flags. */
+ unsigned int execheap: 1;
+
+ /* TRUE if PT_PAX_FLAGS segment should be created with PF_MPROTECT
+ flags. */
+ unsigned int noexecheap: 1;
+
/* TRUE if we should warn when adding a DT_TEXTREL to a shared object. */
unsigned int warn_shared_textrel: 1;
diff -durN binutils-2.20.1.orig/include/elf/common.h binutils-2.20.1/include/elf/common.h
--- binutils-2.20.1.orig/include/elf/common.h 2009-08-09 15:42:26.000000000 +0200
+++ binutils-2.20.1/include/elf/common.h 2010-08-17 19:32:11.000000000 +0200
@@ -422,6 +422,7 @@
#define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME /* Solaris uses the same value */
#define PT_GNU_STACK (PT_LOOS + 0x474e551) /* Stack flags */
#define PT_GNU_RELRO (PT_LOOS + 0x474e552) /* Read-only after relocation */
+#define PT_PAX_FLAGS (PT_LOOS + 0x5041580) /* PaX flags */
/* Program segment permissions, in program header p_flags field. */
@@ -432,6 +433,21 @@
#define PF_MASKOS 0x0FF00000 /* New value, Oct 4, 1999 Draft */
#define PF_MASKPROC 0xF0000000 /* Processor-specific reserved bits */
+/* Flags to control PaX behavior. */
+
+#define PF_PAGEEXEC (1 << 4) /* Enable PAGEEXEC */
+#define PF_NOPAGEEXEC (1 << 5) /* Disable PAGEEXEC */
+#define PF_SEGMEXEC (1 << 6) /* Enable SEGMEXEC */
+#define PF_NOSEGMEXEC (1 << 7) /* Disable SEGMEXEC */
+#define PF_MPROTECT (1 << 8) /* Enable MPROTECT */
+#define PF_NOMPROTECT (1 << 9) /* Disable MPROTECT */
+#define PF_RANDEXEC (1 << 10) /* Enable RANDEXEC */
+#define PF_NORANDEXEC (1 << 11) /* Disable RANDEXEC */
+#define PF_EMUTRAMP (1 << 12) /* Enable EMUTRAMP */
+#define PF_NOEMUTRAMP (1 << 13) /* Disable EMUTRAMP */
+#define PF_RANDMMAP (1 << 14) /* Enable RANDMMAP */
+#define PF_NORANDMMAP (1 << 15) /* Disable RANDMMAP */
+
/* Values for section header, sh_type field. */
#define SHT_NULL 0 /* Section header table entry unused */
diff -durN binutils-2.20.1.orig/ld/emultempl/elf32.em binutils-2.20.1/ld/emultempl/elf32.em
--- binutils-2.20.1.orig/ld/emultempl/elf32.em 2010-08-17 19:32:09.000000000 +0200
+++ binutils-2.20.1/ld/emultempl/elf32.em 2010-08-17 19:32:11.000000000 +0200
@@ -2165,6 +2165,16 @@
link_info.noexecstack = TRUE;
link_info.execstack = FALSE;
}
+ else if (strcmp (optarg, "execheap") == 0)
+ {
+ link_info.execheap = TRUE;
+ link_info.noexecheap = FALSE;
+ }
+ else if (strcmp (optarg, "noexecheap") == 0)
+ {
+ link_info.noexecheap = TRUE;
+ link_info.execheap = FALSE;
+ }
EOF
if test -n "$COMMONPAGESIZE"; then
@@ -2243,6 +2253,8 @@
fprintf (file, _("\
-z execstack Mark executable as requiring executable stack\n"));
fprintf (file, _("\
+ -z execheap Mark executable as requiring executable heap\n"));
+ fprintf (file, _("\
-z initfirst Mark DSO to be initialized first at runtime\n"));
fprintf (file, _("\
-z interpose Mark object to interpose all DSOs but executable\n"));
@@ -2266,6 +2278,8 @@
-z nodump Mark DSO not available to dldump\n"));
fprintf (file, _("\
-z noexecstack Mark executable as not requiring executable stack\n"));
+ fprintf (file, _("\
+ -z noexecheap Mark executable as not requiring executable heap\n"));
EOF
if test -n "$COMMONPAGESIZE"; then
diff -durN binutils-2.20.1.orig/ld/ldgram.y binutils-2.20.1/ld/ldgram.y
--- binutils-2.20.1.orig/ld/ldgram.y 2009-09-02 09:25:35.000000000 +0200
+++ binutils-2.20.1/ld/ldgram.y 2010-08-17 19:32:11.000000000 +0200
@@ -1116,6 +1116,8 @@
$$ = exp_intop (0x6474e550);
else if (strcmp (s, "PT_GNU_STACK") == 0)
$$ = exp_intop (0x6474e551);
+ else if (strcmp (s, "PT_PAX_FLAGS") == 0)
+ $$ = exp_intop (0x65041580);
else
{
einfo (_("\

View File

@ -0,0 +1,19 @@
diff -durN binutils-2.20.1.orig/ld/emulparams/elf_i386.sh binutils-2.20.1/ld/emulparams/elf_i386.sh
--- binutils-2.20.1.orig/ld/emulparams/elf_i386.sh 2009-07-29 16:59:23.000000000 +0200
+++ binutils-2.20.1/ld/emulparams/elf_i386.sh 2010-08-17 19:32:12.000000000 +0200
@@ -13,3 +13,13 @@
NO_SMALL_DATA=yes
SEPARATE_GOTPLT=12
IREL_IN_PLT=
+
+# In Gentoo, we install 32bit libs into /lib32 in an
+# ABI setup with amd64/x86
+case "$target" in
+ x86_64*-linux*)
+ case "$EMULATION_NAME" in
+ *i386*) LIBPATH_SUFFIX=32 ;;
+ esac
+ ;;
+esac

View File

@ -0,0 +1,66 @@
textrels are bad for forcing copy-on-write (this affects everyone),
and for security/runtime code generation, this affects security ppl.
But in either case, it doesn't matter who needs textrels, it's
the very fact that they're needed at all.
2006-06-10 Ned Ludd <solar@gentoo.org>, Mike Frysinger <vapier@gentoo.org>
* bfd/elflink.c (bfd_elf_final_link): Check all objects for TEXTRELs.
* ld/ldmain.c (main): Change textrel warning default to true.
* ld/testsuite/lib/ld-lib.exp (default_ld_simple_link): Scrub TEXTREL
warnings from ld output.
diff -durN binutils-2.20.1.orig/bfd/elflink.c binutils-2.20.1/bfd/elflink.c
--- binutils-2.20.1.orig/bfd/elflink.c 2010-08-17 19:32:11.000000000 +0200
+++ binutils-2.20.1/bfd/elflink.c 2010-08-17 19:32:13.000000000 +0200
@@ -10988,14 +10988,12 @@
goto error_return;
/* Check for DT_TEXTREL (late, in case the backend removes it). */
- if (info->warn_shared_textrel && info->shared)
+ o = bfd_get_section_by_name (dynobj, ".dynamic");
+ if (info->warn_shared_textrel && o != NULL)
{
bfd_byte *dyncon, *dynconend;
/* Fix up .dynamic entries. */
- o = bfd_get_section_by_name (dynobj, ".dynamic");
- BFD_ASSERT (o != NULL);
-
dyncon = o->contents;
dynconend = o->contents + o->size;
for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn)
@@ -11007,7 +11005,7 @@
if (dyn.d_tag == DT_TEXTREL)
{
info->callbacks->einfo
- (_("%P: warning: creating a DT_TEXTREL in a shared object.\n"));
+ (_("%P: warning: creating a DT_TEXTREL in object.\n"));
break;
}
}
diff -durN binutils-2.20.1.orig/ld/ldmain.c binutils-2.20.1/ld/ldmain.c
--- binutils-2.20.1.orig/ld/ldmain.c 2009-09-14 13:43:29.000000000 +0200
+++ binutils-2.20.1/ld/ldmain.c 2010-08-17 19:32:13.000000000 +0200
@@ -280,6 +280,7 @@
emulation = get_emulation (argc, argv);
ldemul_choose_mode (emulation);
default_target = ldemul_choose_target (argc, argv);
+ link_info.warn_shared_textrel = TRUE;
config.maxpagesize = bfd_emul_get_maxpagesize (default_target);
config.commonpagesize = bfd_emul_get_commonpagesize (default_target);
lang_init ();
diff -durN binutils-2.20.1.orig/ld/testsuite/lib/ld-lib.exp binutils-2.20.1/ld/testsuite/lib/ld-lib.exp
--- binutils-2.20.1.orig/ld/testsuite/lib/ld-lib.exp 2009-10-02 12:51:13.000000000 +0200
+++ binutils-2.20.1/ld/testsuite/lib/ld-lib.exp 2010-08-17 19:32:13.000000000 +0200
@@ -196,6 +196,10 @@
# symbol, since the default linker script might use ENTRY.
regsub -all "(^|\n)(\[^\n\]*: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output
+ # Gentoo tweak:
+ # We want to ignore TEXTREL warnings since we force enable them by default
+ regsub -all "^lt-ld-new: warning: creating a DT_TEXTREL in object\." $exec_output "\\1" exec_output
+
if [string match "" $exec_output] then {
return 1
} else {

View File

@ -0,0 +1,13 @@
diff -durN binutils-2.20.1.orig/ld/ldmain.c binutils-2.20.1/ld/ldmain.c
--- binutils-2.20.1.orig/ld/ldmain.c 2010-08-17 19:32:13.000000000 +0200
+++ binutils-2.20.1/ld/ldmain.c 2010-08-17 19:32:15.000000000 +0200
@@ -262,6 +262,7 @@
link_info.allow_undefined_version = TRUE;
link_info.keep_memory = TRUE;
+ link_info.new_dtags = TRUE;
link_info.combreloc = TRUE;
link_info.strip_discarded = TRUE;
link_info.emit_hash = TRUE;

View File

@ -0,0 +1,18 @@
Index: binutils-2.19.51.0.5/ld/ld.texinfo
===================================================================
diff -durN binutils-2.20.1.orig/ld/ld.texinfo binutils-2.20.1/ld/ld.texinfo
--- binutils-2.20.1.orig/ld/ld.texinfo 2009-07-06 15:48:51.000000000 +0200
+++ binutils-2.20.1/ld/ld.texinfo 2010-08-17 19:32:16.000000000 +0200
@@ -2026,8 +2026,9 @@
systems may not understand them. If you specify
@option{--enable-new-dtags}, the dynamic tags will be created as needed.
If you specify @option{--disable-new-dtags}, no new dynamic tags will be
-created. By default, the new dynamic tags are not created. Note that
-those options are only available for ELF systems.
+created. On Gentoo, by default, the new dynamic tags are created (this
+differs from upstream behaviour). Note that those options are only
+available for ELF systems.
@kindex --hash-size=@var{number}
@item --hash-size=@var{number}

View File

@ -0,0 +1,13 @@
diff -durN binutils-2.20.1.orig/ld/ldmain.c binutils-2.20.1/ld/ldmain.c
--- binutils-2.20.1.orig/ld/ldmain.c 2010-08-17 19:32:17.000000000 +0200
+++ binutils-2.20.1/ld/ldmain.c 2010-08-17 19:32:18.000000000 +0200
@@ -264,6 +264,7 @@
link_info.keep_memory = TRUE;
link_info.new_dtags = TRUE;
link_info.combreloc = TRUE;
+ link_info.relro = TRUE;
link_info.strip_discarded = TRUE;
link_info.emit_hash = TRUE;
#ifndef __mips__

View File

@ -0,0 +1,13 @@
diff -durN binutils-2.20.1.orig/libiberty/Makefile.in binutils-2.20.1/libiberty/Makefile.in
--- binutils-2.20.1.orig/libiberty/Makefile.in 2009-08-23 21:03:58.000000000 +0200
+++ binutils-2.20.1/libiberty/Makefile.in 2010-08-17 19:32:19.000000000 +0200
@@ -227,6 +227,7 @@
$(AR) $(AR_FLAGS) $(TARGETLIB) \
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
$(RANLIB) $(TARGETLIB); \
+ cp $(TARGETLIB) ../ ; \
cd ..; \
else true; fi

View File

@ -0,0 +1,27 @@
Description: correct where ld scripts are installed
Author: Chris Chimelis <chris@debian.org>
diff -durN binutils-2.20.1.orig/ld/Makefile.am binutils-2.20.1/ld/Makefile.am
--- binutils-2.20.1.orig/ld/Makefile.am 2010-02-22 09:07:01.000000000 +0100
+++ binutils-2.20.1/ld/Makefile.am 2010-08-17 19:32:21.000000000 +0200
@@ -24,7 +24,7 @@
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
EMUL = @EMUL@
EMULATION_OFILES = @EMULATION_OFILES@
diff -durN binutils-2.20.1.orig/ld/Makefile.in binutils-2.20.1/ld/Makefile.in
--- binutils-2.20.1.orig/ld/Makefile.in 2010-03-03 15:06:21.000000000 +0100
+++ binutils-2.20.1/ld/Makefile.in 2010-08-17 19:32:21.000000000 +0200
@@ -333,7 +333,7 @@
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
BASEDIR = $(srcdir)/..
BFDDIR = $(BASEDIR)/bfd
INCDIR = $(BASEDIR)/include

View File

@ -0,0 +1,26 @@
diff -u binutils-2.20.orig/configure binutils-2.20/configure
diff -durN binutils-2.20.1.orig/configure binutils-2.20.1/configure
--- binutils-2.20.1.orig/configure 2010-08-17 19:32:07.000000000 +0200
+++ binutils-2.20.1/configure 2010-08-17 19:32:22.000000000 +0200
@@ -3086,7 +3086,7 @@
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
libgloss_dir=arm
;;
- arm*-*-linux-gnueabi)
+ arm*-*-linux-*gnueabi)
noconfigdirs="$noconfigdirs target-qthreads"
case ${with_newlib} in
no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
diff -durN binutils-2.20.1.orig/configure.ac binutils-2.20.1/configure.ac
--- binutils-2.20.1.orig/configure.ac 2010-08-17 19:32:07.000000000 +0200
+++ binutils-2.20.1/configure.ac 2010-08-17 19:32:22.000000000 +0200
@@ -573,7 +573,7 @@
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
libgloss_dir=arm
;;
- arm*-*-linux-gnueabi)
+ arm*-*-linux-*gnueabi)
noconfigdirs="$noconfigdirs target-qthreads"
case ${with_newlib} in
no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"

View File

@ -0,0 +1,45 @@
#!/bin/sh -e
## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Specify which filename is causing an error if the filename is a
## DP: directory. (#45832)
if [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
case "$1" in
-patch) patch $patch_opts -p1 < $0;;
-unpatch) patch $patch_opts -p1 -R < $0;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1;;
esac
exit 0
@DPATCH@
diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c binutils-2.14.90.0.6/bfd/opncls.c
diff -durN binutils-2.20.1.orig/bfd/opncls.c binutils-2.20.1/bfd/opncls.c
--- binutils-2.20.1.orig/bfd/opncls.c 2010-01-14 11:48:22.000000000 +0100
+++ binutils-2.20.1/bfd/opncls.c 2010-08-17 19:32:23.000000000 +0200
@@ -183,6 +183,13 @@
{
bfd *nbfd;
const bfd_target *target_vec;
+ struct stat s;
+
+ if (stat (filename, &s) == 0)
+ if (S_ISDIR(s.st_mode)) {
+ bfd_set_error (bfd_error_file_not_recognized);
+ return NULL;
+ }
nbfd = _bfd_new_bfd ();
if (nbfd == NULL)

View File

@ -0,0 +1,96 @@
Description:
This patch is needed in situations where build system is running same version of
binutils that is intended to be built cross-native ( build != host = target)
and has shared libraries enabled. binutils/binutils
Makefile has some tools which are built to run on build system. Toplevel makefile
for binutils passes HOST_EXPORTS to sub-makefiles which also include RPATH_ENVVARS
containing LD_LIBRARY_PATH which is modified so that it also includes host libraries
like opcodes and libbfd which are just built for the host system.
Now the problem is that same LD_LIBRARY_PATH value gets set in environment even
for the tools that are being built for build system using CC_FOR_BUILD and the tools
like as,ld it invokes from build machine get the LD_LIBRARY_PATH set to search
the newly build host libraries like opcodes and bfd and if host is like a big endian
system say (mips-linux) the build system linker and assembler do not run because
ld.so tries to load these shared libraries instead of the ones from /usr/lib for
the build tools.
This patch fixes the issue by clearing LD_LIBRARY_PATH for BUILD tools
This patch would be needed on other versions of binutils. I just cared about 2.20
May be upstream is also interested in such a patch.
-Khem
Index: binutils-2.20/binutils/Makefile.am
===================================================================
diff -durN binutils-2.20.1.orig/binutils/Makefile.am binutils-2.20.1/binutils/Makefile.am
--- binutils-2.20.1.orig/binutils/Makefile.am 2010-01-14 11:48:22.000000000 +0100
+++ binutils-2.20.1/binutils/Makefile.am 2010-08-17 19:32:24.000000000 +0200
@@ -251,24 +251,24 @@
./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
- $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
syslex.o: syslex.c sysinfo.h config.h
if [ -r syslex.c ]; then \
- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) syslex.c ; \
+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) syslex.c ; \
else \
- $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex.c ;\
+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex.c ;\
fi
sysinfo.o: sysinfo.c
if [ -r sysinfo.c ]; then \
- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \
+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \
else \
- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \
+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \
fi
bin2c$(EXEEXT_FOR_BUILD):
- $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
embedspu: embedspu.sh
sed "s@^program_transform_name=@program_transform_name=$(program_transform_name)@" < $< > $@
diff -durN binutils-2.20.1.orig/binutils/Makefile.in binutils-2.20.1/binutils/Makefile.in
--- binutils-2.20.1.orig/binutils/Makefile.in 2010-03-03 14:59:46.000000000 +0100
+++ binutils-2.20.1/binutils/Makefile.in 2010-08-17 19:32:24.000000000 +0200
@@ -1193,24 +1193,24 @@
./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
- $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
syslex.o: syslex.c sysinfo.h config.h
if [ -r syslex.c ]; then \
- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) syslex.c ; \
+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) syslex.c ; \
else \
- $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex.c ;\
+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex.c ;\
fi
sysinfo.o: sysinfo.c
if [ -r sysinfo.c ]; then \
- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \
+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \
else \
- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \
+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \
fi
bin2c$(EXEEXT_FOR_BUILD):
- $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
embedspu: embedspu.sh
sed "s@^program_transform_name=@program_transform_name=$(program_transform_name)@" < $< > $@

View File

@ -0,0 +1,24 @@
diff -p -c -u -r1.196 elf32-arm.c
diff -durN binutils-2.20.1.orig/bfd/elf32-arm.c binutils-2.20.1/bfd/elf32-arm.c
--- binutils-2.20.1.orig/bfd/elf32-arm.c 2010-02-22 09:06:48.000000000 +0100
+++ binutils-2.20.1/bfd/elf32-arm.c 2010-08-17 19:32:25.000000000 +0200
@@ -3194,11 +3194,15 @@
/* We have an extra 2-bytes reach because of
the mode change (bit 24 (H) of BLX encoding). */
+ /* A stub is needed only if this call is not throught a PLT
+ entry, because PLT stubs handle mode switching
+ already. */
if (branch_offset > (ARM_MAX_FWD_BRANCH_OFFSET + 2)
|| (branch_offset < ARM_MAX_BWD_BRANCH_OFFSET)
- || ((r_type == R_ARM_CALL) && !globals->use_blx)
- || (r_type == R_ARM_JUMP24)
- || (r_type == R_ARM_PLT32))
+ || ( (((r_type == R_ARM_CALL) && !globals->use_blx)
+ || (r_type == R_ARM_JUMP24)
+ || (r_type == R_ARM_PLT32))
+ && !use_plt))
{
stub_type = (info->shared | globals->pic_veneer)
/* PIC stubs. */

View File

@ -0,0 +1,21 @@
diff -durN binutils-2.20.1.orig/ld/configure.tgt binutils-2.20.1/ld/configure.tgt
--- binutils-2.20.1.orig/ld/configure.tgt 2009-08-06 19:38:03.000000000 +0200
+++ binutils-2.20.1/ld/configure.tgt 2010-08-17 19:32:26.000000000 +0200
@@ -400,11 +400,11 @@
mips*-*-vxworks*) targ_emul=elf32ebmipvxworks
targ_extra_emuls="elf32elmipvxworks" ;;
mips*-*-windiss) targ_emul=elf32mipswindiss ;;
-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+mips64*el-*-linux-*) targ_emul=elf64ltsmip
+ targ_extra_emuls="elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
targ_extra_libpath=$targ_extra_emuls ;;
-mips64*-*-linux-*) targ_emul=elf32btsmipn32
- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+mips64*-*-linux-*) targ_emul=elf64btsmip
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
targ_extra_libpath=$targ_extra_emuls ;;
mips*el-*-linux-*) targ_emul=elf32ltsmip
targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"

View File

@ -0,0 +1,24 @@
diff -durN binutils-2.21.1.orig/configure binutils-2.21.1/configure
--- binutils-2.21.1.orig/configure 2011-06-27 09:39:00.000000000 +0200
+++ binutils-2.21.1/configure 2011-09-12 13:39:06.292251293 +0200
@@ -3180,7 +3180,7 @@
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
libgloss_dir=arm
;;
- arm*-*-linux-gnueabi)
+ arm*-*-linux-*gnueabi)
noconfigdirs="$noconfigdirs target-qthreads"
case ${with_newlib} in
no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
diff -durN binutils-2.21.1.orig/configure.ac binutils-2.21.1/configure.ac
--- binutils-2.21.1.orig/configure.ac 2011-06-27 11:08:53.000000000 +0200
+++ binutils-2.21.1/configure.ac 2011-09-12 13:39:06.308917895 +0200
@@ -652,7 +652,7 @@
noconfigdirs="$noconfigdirs target-libffi target-qthreads"
libgloss_dir=arm
;;
- arm*-*-linux-gnueabi)
+ arm*-*-linux-*gnueabi)
noconfigdirs="$noconfigdirs target-qthreads"
case ${with_newlib} in
no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"

View File

@ -0,0 +1,42 @@
diff -durN binutils-2.21.1.orig/configure binutils-2.21.1/configure
--- binutils-2.21.1.orig/configure 2011-09-12 13:39:06.292251293 +0200
+++ binutils-2.21.1/configure 2011-09-12 13:39:07.135581381 +0200
@@ -3148,7 +3148,7 @@
am33_2.0-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
- sh-*-linux*)
+ sh*-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
sh*-*-pe|mips*-*-pe|*arm-wince-pe)
@@ -3487,7 +3487,7 @@
romp-*-*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
;;
- sh-*-* | sh64-*-*)
+ sh*-*-* | sh64-*-*)
case "${host}" in
i[3456789]86-*-vsta) ;; # don't add gprof back in
i[3456789]86-*-go32*) ;; # don't add gprof back in
diff -durN binutils-2.21.1.orig/configure.ac binutils-2.21.1/configure.ac
--- binutils-2.21.1.orig/configure.ac 2011-09-12 13:39:06.308917895 +0200
+++ binutils-2.21.1/configure.ac 2011-09-12 13:39:07.145581342 +0200
@@ -620,7 +620,7 @@
am33_2.0-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
- sh-*-linux*)
+ sh*-*-linux*)
noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
;;
sh*-*-pe|mips*-*-pe|*arm-wince-pe)
@@ -959,7 +959,7 @@
romp-*-*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
;;
- sh-*-* | sh64-*-*)
+ sh*-*-* | sh64-*-*)
case "${host}" in
i[[3456789]]86-*-vsta) ;; # don't add gprof back in
i[[3456789]]86-*-go32*) ;; # don't add gprof back in

View File

@ -0,0 +1,24 @@
diff -durN binutils-2.21.1.orig/ld/Makefile.am binutils-2.21.1/ld/Makefile.am
--- binutils-2.21.1.orig/ld/Makefile.am 2011-03-16 09:37:30.000000000 +0100
+++ binutils-2.21.1/ld/Makefile.am 2011-09-12 13:39:07.962244866 +0200
@@ -37,7 +37,7 @@
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
EMUL = @EMUL@
EMULATION_OFILES = @EMULATION_OFILES@
diff -durN binutils-2.21.1.orig/ld/Makefile.in binutils-2.21.1/ld/Makefile.in
--- binutils-2.21.1.orig/ld/Makefile.in 2011-03-16 09:37:30.000000000 +0100
+++ binutils-2.21.1/ld/Makefile.in 2011-09-12 13:39:07.962244866 +0200
@@ -365,7 +365,7 @@
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
BASEDIR = $(srcdir)/..
BFDDIR = $(BASEDIR)/bfd
INCDIR = $(BASEDIR)/include

View File

@ -0,0 +1,21 @@
diff -durN binutils-2.21.1.orig/ld/emultempl/elf32.em binutils-2.21.1/ld/emultempl/elf32.em
--- binutils-2.21.1.orig/ld/emultempl/elf32.em 2011-06-27 09:39:14.000000000 +0200
+++ binutils-2.21.1/ld/emultempl/elf32.em 2011-09-12 13:39:08.808908274 +0200
@@ -1272,6 +1272,8 @@
&& command_line.rpath == NULL)
{
lib_path = (const char *) getenv ("LD_RUN_PATH");
+ if ((lib_path) && (strlen (lib_path) == 0))
+ lib_path = NULL;
if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
force))
break;
@@ -1499,6 +1501,8 @@
rpath = command_line.rpath;
if (rpath == NULL)
rpath = (const char *) getenv ("LD_RUN_PATH");
+ if ((rpath) && (strlen (rpath) == 0))
+ rpath = NULL;
for (abfd = link_info.input_bfds; abfd; abfd = abfd->link_next)
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)

View File

@ -0,0 +1,31 @@
r10231 | lethal | 2005-05-02 09:58:00 -0400 (Mon, 02 May 2005) | 13 lines
Likewise, binutils has no idea about any of these new targets either, so we
fix that up too.. now we're able to actually build a real toolchain for
sh2a_nofpu- and other more ineptly named toolchains (and yes, there are more
inept targets than that one, really. Go look, I promise).
diff -durN binutils-2.22.orig/configure binutils-2.22/configure
--- binutils-2.22.orig/configure 2011-08-14 14:28:15.000000000 +0200
+++ binutils-2.22/configure 2011-12-14 19:49:40.284777434 +0100
@@ -3570,7 +3570,7 @@
mips*-*-*)
noconfigdirs="$noconfigdirs gprof"
;;
- sh-*-* | sh64-*-*)
+ sh*-*-* | sh64-*-*)
case "${target}" in
sh*-*-elf)
;;
diff -durN binutils-2.22.orig/configure.ac binutils-2.22/configure.ac
--- binutils-2.22.orig/configure.ac 2011-11-21 12:58:27.000000000 +0100
+++ binutils-2.22/configure.ac 2011-12-14 19:49:40.316777436 +0100
@@ -1006,7 +1006,7 @@
mips*-*-*)
noconfigdirs="$noconfigdirs gprof"
;;
- sh-*-* | sh64-*-*)
+ sh*-*-* | sh64-*-*)
case "${target}" in
sh*-*-elf)
;;

View File

@ -0,0 +1,24 @@
diff -durN binutils-2.22.orig/ld/Makefile.am binutils-2.22/ld/Makefile.am
--- binutils-2.22.orig/ld/Makefile.am 2011-07-22 22:22:37.000000000 +0200
+++ binutils-2.22/ld/Makefile.am 2011-12-14 19:50:25.760779164 +0100
@@ -37,7 +37,7 @@
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
EMUL = @EMUL@
EMULATION_OFILES = @EMULATION_OFILES@
diff -durN binutils-2.22.orig/ld/Makefile.in binutils-2.22/ld/Makefile.in
--- binutils-2.22.orig/ld/Makefile.in 2011-07-22 22:22:37.000000000 +0200
+++ binutils-2.22/ld/Makefile.in 2011-12-14 19:50:25.784779163 +0100
@@ -366,7 +366,7 @@
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
BASEDIR = $(srcdir)/..
BFDDIR = $(BASEDIR)/bfd
INCDIR = $(BASEDIR)/include

Some files were not shown because too many files have changed in this diff Show More