public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* building gcc 3.0.4 on mips-dec-osf1: where are CPP definitions set?
@ 2023-03-20 23:46 Dennis Grevenstein
  2023-03-21  0:04 ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: Dennis Grevenstein @ 2023-03-20 23:46 UTC (permalink / raw)
  To: gcc-help

Hi,

I’ve got an unusual problem. I have on old DECstation (MIPS R3000
based) running the infamous OSF/1. I got gcc-2.7.2.3 compiled and
working and I am now trying to upgrade to 3.0.4.
One problem I found is that gcc-3.0.4 no longer defines
#define __LANGUAGE_C__ 1 
and a number of header files depend on it.
It still defines
#define __LANGUAGE_C 1
but of course that is not the same.
gcc-2.7.2.3 still defined it correctly. I assume that this is just an
error in some file, but I can’t find where these defines are set.


this is what gcc-2.7.2.3 sets:

# gcc -v
Reading specs from /usr/local/lib/gcc-lib/mips-dec-osf/2.7.2.3/specs
gcc version 2.7.2.3

# gcc -dM -E - < /dev/null
#define __LANGUAGE_C 1 
#define R3000 1 
#define __SYSTYPE_BSD__ 1 
#define SYSTYPE_BSD 1 
#define __host_mips 1 
#define __MIPSEL__ 1 
#define __ANSI_COMPAT 1 
#define __MIPSEL 1 
#define __mips__ 1 
#define __mips 1 
#define __host_mips__ 1 
#define __osf 1 
#define __GNUC_MINOR__ 7 
#define MIPSEL 1 
#define __R3000__ 1 
#define __PTRDIFF_TYPE__ int 
#define host_mips 1 
#define __SYSTYPE_BSD 1 
#define mips 1 
#define __LANGUAGE_C__ 1 
#define __unix 1 
#define osf 1 
#define __osf__ 1 
#define __R3000 1 
#define __unix__ 1 
#define __bsd4_2 1 
#define __bsd4_2__ 1 
#define __GNUC__ 2 
#define LANGUAGE_C 1 
#define _SYSTYPE_BSD 1 
#define bsd4_2 1 
#define unix 1 


this is what the new stage1 gcc-3.0.4 sets:

# stage1/xgcc -Bstage1/ -B/usr/local/mips-dec-osf1/bin/ -c  -DIN_GCC    -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes   -DHAVE_CONFIG_H    -I. -Icp -I../../gcc-3.0.4/gcc -I../../gcc-3.0.4/gcc/cp -I../../gcc-3.0.4/gcc/config -I../../gcc-3.0.4/gcc/../include -dM -E - < /dev/null
#define __USER_LABEL_PREFIX__
#define __host_mips 1
#define HAVE_CONFIG_H 1
#define __SYSTYPE_BSD 1
#define __R3000__ 1
#define __osf 1
#define __PTRDIFF_TYPE__ int
#define bsd4_2 1
#define __HAVE_BUILTIN_SETJMP__ 1
#define MIPSEL 1
#define __host_mips__ 1
#define __GNUC_PATCHLEVEL__ 4
#define __mips 1
#define __WCHAR_TYPE__ short unsigned int
#define __osf__ 1
#define LANGUAGE_C 1
#define __MIPSEL__ 1
#define __R3000 1
#define __GNUC_MINOR__ 0
#define osf 1
#define __WINT_TYPE__ unsigned int
#define IN_GCC 1
#define __SYSTYPE_BSD__ 1
#define __ANSI_COMPAT 1
#define SYSTYPE_BSD 1
#define __unix 1
#define unix 1
#define __mips__ 1
#define __LANGUAGE_C 1
#define R3000 1
#define __bsd4_2 1
#define __OPTIMIZE__ 1
#define __MIPSEL 1
#define __REGISTER_PREFIX__
#define __GNUC__ 3
#define __bsd4_2_ 1
#define _LANGUAGE_C 1
#define __VERSION__ "3.0.4"
#define mips 1
#define _SYSTYPE_BSD 1
#define __STDC_HOSTED__ 1
#define host_mips 1
#define __unix__ 1
#define __STDC__ 1


thanks,
Dennis

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

* Re: building gcc 3.0.4 on mips-dec-osf1: where are CPP definitions set?
  2023-03-20 23:46 building gcc 3.0.4 on mips-dec-osf1: where are CPP definitions set? Dennis Grevenstein
@ 2023-03-21  0:04 ` Jonathan Wakely
  2023-03-22 19:19   ` Dennis Grevenstein
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2023-03-21  0:04 UTC (permalink / raw)
  To: Dennis Grevenstein; +Cc: gcc-help

On Mon, 20 Mar 2023 at 23:47, Dennis Grevenstein via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> Hi,
>
> I’ve got an unusual problem. I have on old DECstation (MIPS R3000
> based) running the infamous OSF/1. I got gcc-2.7.2.3 compiled and
> working and I am now trying to upgrade to 3.0.4.
> One problem I found is that gcc-3.0.4 no longer defines
> #define __LANGUAGE_C__ 1
> and a number of header files depend on it.
> It still defines
> #define __LANGUAGE_C 1
> but of course that is not the same.
> gcc-2.7.2.3 still defined it correctly. I assume that this is just an
> error in some file, but I can’t find where these defines are set.

I think it's a call to builtin_define in gcc/config/mips/mips.h

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

* Re: building gcc 3.0.4 on mips-dec-osf1: where are CPP definitions set?
  2023-03-21  0:04 ` Jonathan Wakely
@ 2023-03-22 19:19   ` Dennis Grevenstein
  2023-03-23 17:16     ` Dennis Grevenstein
  0 siblings, 1 reply; 4+ messages in thread
From: Dennis Grevenstein @ 2023-03-22 19:19 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

Hi,

> Am 21.03.2023 um 01:04 schrieb Jonathan Wakely <jwakely.gcc@gmail.com>:
> 
>> I’ve got an unusual problem. I have on old DECstation (MIPS R3000
>> based) running the infamous OSF/1. I got gcc-2.7.2.3 compiled and
>> working and I am now trying to upgrade to 3.0.4.
>> One problem I found is that gcc-3.0.4 no longer defines
>> #define __LANGUAGE_C__ 1
>> and a number of header files depend on it.
>> It still defines
>> #define __LANGUAGE_C 1
>> but of course that is not the same.
>> gcc-2.7.2.3 still defined it correctly. I assume that this is just an
>> error in some file, but I can’t find where these defines are set.
> 
> I think it's a call to builtin_define in gcc/config/mips/mips.h

this is correct and I eventually got gcc-3.0.4 compiled.
However, the resulting gcc doesn’t fully work. It can go through
stage2 and it can build some apps like GNU sed, but will produce
binaries that fail with a Signal 11 with some other apps.
I think I would rather go back to gcc-2.7.2.3.

thank you anyway…

regards,
Dennis

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

* Re: building gcc 3.0.4 on mips-dec-osf1: where are CPP definitions set?
  2023-03-22 19:19   ` Dennis Grevenstein
@ 2023-03-23 17:16     ` Dennis Grevenstein
  0 siblings, 0 replies; 4+ messages in thread
From: Dennis Grevenstein @ 2023-03-23 17:16 UTC (permalink / raw)
  To: gcc-help



> Am 22.03.2023 um 20:19 schrieb Dennis Grevenstein <dennis.grevenstein@gmail.com>:
> 
>> Am 21.03.2023 um 01:04 schrieb Jonathan Wakely <jwakely.gcc@gmail.com>:
>> 
>>> I’ve got an unusual problem. I have on old DECstation (MIPS R3000
>>> based) running the infamous OSF/1. I got gcc-2.7.2.3 compiled and
>>> working and I am now trying to upgrade to 3.0.4.
>>> One problem I found is that gcc-3.0.4 no longer defines
>>> #define __LANGUAGE_C__ 1
>>> and a number of header files depend on it.
>>> It still defines
>>> #define __LANGUAGE_C 1
>>> but of course that is not the same.
>>> gcc-2.7.2.3 still defined it correctly. I assume that this is just an
>>> error in some file, but I can’t find where these defines are set.
>> 
>> I think it's a call to builtin_define in gcc/config/mips/mips.h
> 
> this is correct and I eventually got gcc-3.0.4 compiled.
> However, the resulting gcc doesn’t fully work. It can go through
> stage2 and it can build some apps like GNU sed, but will produce
> binaries that fail with a Signal 11 with some other apps.
> I think I would rather go back to gcc-2.7.2.3.

just a little FYI for any future retro-computing hobbyists:
I have built gcc-2.8.1:

../gcc-2.8.1/configure --enable-languages=c,c++,f77 --disable-nls --with-as=/usr/bin/as --with-ld=/usr/bin/ld --disable-shared --prefix=/usr/local/gcc281 mips-dec-osf1

It needed a small fix in gcc-2.8.1/config/mips/mips.h, where I had
to add the missing definition of „-D__LANGUAGE_C__“.

It is also important NOT to specify the „--without-gnu-as“,
because it will make gcc produce assembler code that the
MIPS as can’t process.
This gcc apparently works fine. I could build some packages
that work correctly.

regards,
Dennis


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

end of thread, other threads:[~2023-03-23 17:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20 23:46 building gcc 3.0.4 on mips-dec-osf1: where are CPP definitions set? Dennis Grevenstein
2023-03-21  0:04 ` Jonathan Wakely
2023-03-22 19:19   ` Dennis Grevenstein
2023-03-23 17:16     ` Dennis Grevenstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).