🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #42744

Re: HOW: a.out with gcc 2.7.0 and linux ?

#42744
From: Gregory H. Margo
Date: Mon, 06 Nov 1995 00:00
42 lines
1876 bytes
>Wednesday November 01 1995 16:23, Lutz Wrage wrote to All:
>
> LW> I just tried to compile the linux-1.2.13 kernel with gcc-2.7.0. It
> LW> works fine until the linker warns about undefined symbols.
>
> LW> I think I have to explicitly tell gcc (and ld?) to produce an a.out
> LW> executable, but I was not able to figure out the right option
> LW> settings. Can anybody help?


I recompiled my linux-1.2.13 kernel in a.out format with gcc-2.7.0.
Check the following patch for the top level Makefile for my changes:

diff -u Makefile.dist Makefile
--- Makefile.dist	Mon Nov  6 09:40:40 1995
+++ Makefile	Mon Nov  6 09:46:06 1995
@@ -11,10 +11,10 @@
 	  else echo sh; fi ; fi)
 TOPDIR	:= $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
 
-AS	=as
-LD	=ld
+AS	=/usr/i486-linuxaout/bin/as
+LD	=ld -m i386linux
 HOSTCC	=gcc -I$(TOPDIR)/include
-CC	=gcc -D__KERNEL__ -I$(TOPDIR)/include
+CC	=gcc -b i486-linuxaout -D__KERNEL__ -I$(TOPDIR)/include
 MAKE	=make
 CPP	=$(CC) -E
 AR	=ar
@@ -69,6 +69,7 @@
 #
 
 CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+CFLAGS += -fno-strength-reduce
 
 ifdef CONFIG_CPP
 CFLAGS := $(CFLAGS) -x c++
-- 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Gregory H. Margo                 No free speech restrictions on the Internet!
gmargo@newton.vip.best.com       ms windows makes me ill      newton@best.com
Technical Details
Message-ID: <47lhp0$5f7@shellx.best.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <47irmi$6kr@xmission.xmission.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,60169f69d41f7d19
X-Google-Attributes: gid11318c,public
From: newton@shellx.best.com (Gregory H. Margo)
Subject: Re: HOW: a.out with gcc 2.7.0 and linux ?
Date: 1995/11/06
Message-ID: <47lhp0$5f7@shellx.best.com>
X-Deja-AN: 118699732
references: <47irmi$6kr@xmission.xmission.com>
organization: Not Much
reply-to: gmargo@newton.vip.best.com
newsgroups: gnu.gcc.help