delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/03/05/08:44:46

X-Authentication-Warning: ieva01.lanet.lv: pavenis owned process doing -bs
Date: Fri, 5 Mar 1999 15:38:44 +0200 (WET)
From: Andris Pavenis <pavenis AT lanet DOT lv>
To: djgpp-workers AT delorie DOT com
Subject: cross-binutils for DJGPP under Linux
Message-ID: <Pine.A41.4.05.9903051529560.43886-100000@ieva01.lanet.lv>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

Hi!

Well, I rebuild cross-binutils (2.9.1) under Linux (perhaps best to do
that after upgrade system from libc-5.4.46 to glibc-2.1). 

I still left out patch from Mark E. to build GAS as BFD assembler (it
seems that BFD assembler is still broken even after that patch) but I
included patch from Lazlo Molnar to fix problems with strip.

I'm including shell script to build binutils-2.9.1 (should work both
for building native binutils for DJGPP and cross-binutils). Simply throw
this script and binutils-2.9.1.tar.gz in the same directory and run the 
script (tar.exe must be installed and LFN support must be available when 
building native binutils). I didn't include 'make install' as I perefer
to install into temporary directory and copy needed files manually.

Seems that there are no serious problems with cross-binutils (I build
them on i586-pc-linux-gnu host)

Andris



#! /bin/sh
#
VERSION=2.9.1
NAME=binutils-${VERSION}
PWD=`pwd`
CONF_OPT="--target=i586-pc-msdosdjgpp"
PREFIX=/usr
#
####  Unpack binutils archive
#
tar xzvf ${NAME}.tar.gz
#
HOST=`(cd binutils-$VERSION; ./config.guess)`
########################################################
( cd ${NAME} && \
patch --verbose --backup -N -p1 << 'EOF'
--- binutils-2.9.1/bfd/coff-i386.c.orig	Fri May  1 15:48:04 1998
+++ binutils-2.9.1/bfd/coff-i386.c	Thu Mar  4 20:33:02 1999
@@ -48,7 +48,9 @@
 #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
 /* The page size is a guess based on ELF.  */
 
+#ifndef COFF_GO32_EXE
 #define COFF_PAGE_SIZE 0x1000
+#endif
 
 /* For some reason when using i386 COFF the value stored in the .text
    section for a reference to a common symbol is the value itself plus
--- binutils-2.9.1/gas/config/te-go32.h.orig	Fri May  1 15:44:48 1998
+++ binutils-2.9.1/gas/config/te-go32.h	Thu Mar  4 20:13:56 1999
@@ -6,7 +6,7 @@
 #define LOCAL_LABELS_FB 1
 
 #define TARGET_FORMAT "coff-go32"
-
+#define TE_GO32
 /* GAS should treat '.align value' as an alignment of 2**value */
 #define USE_ALIGN_PTWO
 
--- binutils-2.9.1/gas/config/tc-i386.h.orig	Fri May  1 15:44:40 1998
+++ binutils-2.9.1/gas/config/tc-i386.h	Thu Mar  4 20:13:56 1999
@@ -141,9 +141,11 @@
 #ifndef BFD_ASSEMBLER
 #ifndef OBJ_AOUT
 #ifndef TE_PE
+#ifndef TE_GO32
 /* Local labels starts with .L */
 #define LOCAL_LABEL(name) (name[0] == '.' \
 		 && (name[1] == 'L' || name[1] == 'X' || name[1] == '.'))
+#endif
 #endif
 #endif
 #endif
EOF
)
########################################################
case x-$HOST in 
	x-*-pc-msdosdjgpp) 
		export PATH_SEPARATOR=:
		current_drive=`pwd | sed 's,//\(.\).*,\1,'`
		export SYSROOT=$current_drive:/
		export CONFIG_SHELL=/bin/sh.exe
		export LD=ld
		export CC=gcc
		export ac_cv_prog_LN_S=cp
		export AWK=gawk
		export am_cv_exeext=.exe
		export ac_cv_path_install="ginstall -c"
		export ac_cv_path_XGETTEXT=xgettext
		export LEX=flex
		export RANLIB=ranlib
		CONF_OPT="--host=$HOST $CONF_OPT"
		DTOU=dtou
	        ;;
	*) 
		CONF_OPT="--prefix=${PREFIX} --disable-shared ${CONF_OPT}" 
		DTOU=touch
		;;
esac;
#
(
  mkdir build.binutils
  cd build.binutils;
  CFLAGS=-O2 ../${NAME}/configure ${CONF_OPT}; 
  for file in `find . -name 'libtool'`; do ${DTOU} $file; done
  make
)
  

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019