This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Fwd: [Fwd: Success building a sparc64 cross-compiler and glibcwith a patched version of crosstool-0.26]]


Roman, maybe this will help.
- Dan

--- Begin Message ---
Hello,
I have been trying to build a cross-compiler and run-time environment for
sparc64 for some time now. I got it all building after using binutils-2.14
and its --with-sysroot option. I have used gcc-3.2.3, glibc-2.3.2 and
binutils-2.14

In your crosstool.sh you seem to use the sysroot option for both gcc &
binutils, or neither.

It seems binutils-2.14 onwards supports the --with-sysroot option and solves
the problem that you tried to solve by passing "-L" to ld, discussed in:
	http://www.x86-64.org/lists/discuss/msg04357.html

The "--with-sysroot" options sets up the linker-scripts to look in lib64,
obviating the need for any "-L" options to the linker.

I have attached my rather trivial patch to crosstool.sh along with an
invocation of all.sh that created the sparc64 cross-compile and run-time
environment. I attempted to create a sparc (i.e. 32-bit) cross-compile and
run-time environment as well and it built correctly with the patch using
binutils-2.13.2.1.

I have replicated the patch below to explain it:
----------------------------------------------------------------------------

*** ./crosstool.sh      Sat Jan 17 02:07:06 2004
--- /vault/crosstool-0.26/./crosstool.sh        Mon Jan 26 12:52:28 2004
***************
*** 90,96 ****
      # plain old way.  all libraries in prefix/target/lib
      SYSROOT=${PREFIX}/${TARGET}
      HEADERDIR=$SYSROOT/include
-     BINUTILS_SYSROOT_ARG=""
      # Use --with-headers, else final gcc will define disable_glibc while
building libgcc, and you'll have no profiling
      GCC_SYSROOT_ARG_CORE="--without-headers"
      GCC_SYSROOT_ARG="--with-headers=${HEADERDIR}"
--- 90,95 ----
***************
*** 100,106 ****
      # prefix/target/sys-root/lib and prefix/target/sys-root/usr/lib
      SYSROOT=${PREFIX}/${TARGET}/sys-root
      HEADERDIR=$SYSROOT/usr/include
-     BINUTILS_SYSROOT_ARG="--with-sysroot=${SYSROOT}"
      GCC_SYSROOT_ARG="--with-sysroot=${SYSROOT}"
      GCC_SYSROOT_ARG_CORE=$GCC_SYSROOT_ARG
      GLIBC_SYSROOT_ARG=""
--- 99,104 ----
***************
*** 109,114 ****
--- 107,114 ----
      # Note: --prefix=/usr is magic!  See
http://www.gnu.org/software/libc/FAQ.html#s-2.2
  fi

+ BINUTILS_SYSROOT_ARG="--with-sysroot=${SYSROOT}"
+
  # Make lib directory in sysroot, else the ../lib64 hack used by 32 ->
64bit
  # crosscompilers won't work, and build of final gcc will fail with
  #  "ld: cannot open crti.o: No such file or directory"

----------------------------------------------------------------------------
I essentially unconditionally set BINUTILS_SYSROOT_ARG to
"--with-sysroot=${SYSROOT}" as it seems to be ignored by "binutils"s older
than 2.14. BINUTILS_SYSROOT_ARG is null for non USE_SYSROOT runs anyway.

I have successfully built a sparc64 cross-compile and run-time environment
with the following invocation:
----------------------------------------------------------------------------
TMPDIR=/vault/tmp GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2
TARGET=sparc64-unknown-linux-gnu GCC_EXTRA_CONFIG="--disable-multilib"
TARGET_CFLAGS=-O BINUTILS_DIR=binutils-2.14 GCC_DIR=gcc-3.2.3
LINUX_DIR=linux-2.4.22 GLIBC_DIR=glibc-2.3.2 nohup </dev/null ./all.sh
--notest >/tmp/veliath/cross.`date "+%Y%m%d%H%M%S"` 2>&1 &
----------------------------------------------------------------------------

and a sparc cross-compile and run-time environment with the following
invocation:
----------------------------------------------------------------------------
TMPDIR=/vault/tmp GLIBCTHREADS_FILENAME=glibc-linuxthreads-2.3.2
TARGET=sparc-unknown-linux-gnu GCC_EXTRA_CONFIG="--disable-multilib"
TARGET_CFLAGS=-O BINUTILS_DIR=binutils-2.13.2.1 GCC_DIR=gcc-3.2.3
LINUX_DIR=linux-2.4.22 GLIBC_DIR=glibc-2.3.2 nohup </dev/null ./all.sh
--notest >/tmp/veliath/cross.`date "+%Y%m%d%H%M%S"` 2>&1 &
----------------------------------------------------------------------------
[Note the different binutils versions used.]

If you knew all this already, sorry to have taken up your time.

Thank you for a great set of scripts,
veliath
  

Attachment: kegel_pouch.tgz
Description: Binary data


--- End Message ---
------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]