public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* An error occurred when building gcc-3.3.6
@ 2023-10-13 15:00 Dingjun Chen
  2023-10-13 15:29 ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: Dingjun Chen @ 2023-10-13 15:00 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 3941 bytes --]

Hi, guys,

I am trying to build gcc-3.3.6 from Index of /mirrors/gcc/releases/gcc-3.3.6 (bigsearcher.com)<https://bigsearcher.com/mirrors/gcc/releases/gcc-3.3.6/> ,
the following error message occurred. Could you please tell me how to fix it?

My host computer: Dell Inspiron 16 plus 7630.
GCC on host: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
under WSL.

Why do I want to build gcc-3.3.6? because I want to use it to build Linux Kernel 2.4.36. It was requested to build Linux Kernel 2.4.36 with the GCC version < 4.2. (please see: home/dingjun/build_cross_gcc/linux-2.4.36/include/linux/compiler.h:45:2: error: #error "GCC >= 4.2 miscompiles kernel 2.4, do not use it!"
   45 | #error "GCC >= 4.2 miscompiles kernel 2.4, do not use it!")


I tried several gcc version (<4.2) and almost each one has some errors. Could you some tell me which gcc(<4.2 version) source codes are 100% sure to be built without errors?

Thanks & regards,

Dingjun


/***** an error occurred when building gcc-3.3.6************/
In file included from ./config.h:17,
                 from f/proj.h:30,
                 from f/com.c:83:
./tree.h:2244:55: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
 2244 | extern tree build_string                PARAMS ((int, const char *));
      |                                                       ^~~~~~~~~~~~
./../include/ansidecl.h:152:33: note: in definition of macro ‘PARAMS’
  152 | #define PARAMS(ARGS)            ARGS
      |                                 ^~~~
f/com.c: At top level:
f/com.c:11079:1: error: conflicting types for ‘ffecom_gfrt_basictype’; have ‘ffeinfoBasictype(ffecomGfrt)’
11079 | ffecom_gfrt_basictype (ffecomGfrt gfrt)
      | ^~~~~~~~~~~~~~~~~~~~~
In file included from f/com.c:124:
f/com.h:236:17: note: previous declaration of ‘ffecom_gfrt_basictype’ with type ‘ffeinfoKindtype(ffecomGfrt)’
  236 | ffeinfoKindtype ffecom_gfrt_basictype (ffecomGfrt ix);
      |                 ^~~~~~~~~~~~~~~~~~~~~
f/com.c: In function ‘ffecom_init_0’:
f/com.c:11624:28: warning: comparison between ‘ffeinfoKindtype’ and ‘enum <anonymous>’ [-Wenum-compare]
11624 |   if (ffecom_pointer_kind_ == FFEINFO_basictypeNONE)
      |                            ^~
In file included from f/com.c:16573:
./gt-f-com.h: In function ‘gt_ggc_mx_lang_tree_node’:
./gt-f-com.h:65:7: warning: switch condition has boolean value [-Wswitch-bool]
   65 |       switch (TREE_CODE (&((*x)).generic) == IDENTIFIER_NODE)
      |       ^~~~~~
f/com.c: In function ‘ffe_mark_addressable’:
f/com.c:14300:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
14300 |         put_var_into_stack (x, /*rescan=*/true);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
f/com.c:14303:7: note: here
14303 |       case FUNCTION_DECL:
      |       ^~~~
f/com.c:14304:30: warning: this statement may fall through [-Wimplicit-fallthrough=]
14304 |         TREE_ADDRESSABLE (x) = 1;
f/com.c:14310:7: note: here
14310 |       default:
      |       ^~~~~~~
make[1]: *** [Makefile:735: f/com.o] Error 1
make[1]: Leaving directory '/home/dingjun/build_cross_gcc/gcc-3.3.6/gcc'
make: *** [Makefile:1546: all-gcc] Error 2
Dingjun Chen  | Software Developer

[Geotech Airborne Geophysical Surveys]

Geotech Ltd. dba Geotech Airborne | 270 INDUSTRIAL PKY S | AURORA ON CA | L4G 3T9
T: +1 905 841 5004 | Dingjun.Chen@geotechairborne.com<mailto:Dingjun.Chen@geotechairborne.com> | www.geotechairborne.com<www.geotech.ca>

P Please consider the environment before printing this email

This message may contain PRIVILEGED AND PROPRIETARY INFORMATION intended solely for the use of the addressee (s) named above. Any disclosure, distribution, copying, or use of the information by others is strictly prohibited. If you have received this message in error, please advise the sender by immediate reply and delete the original message.

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

* Re: An error occurred when building gcc-3.3.6
  2023-10-13 15:00 An error occurred when building gcc-3.3.6 Dingjun Chen
@ 2023-10-13 15:29 ` Jonathan Wakely
  2023-10-13 15:39   ` Dingjun Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2023-10-13 15:29 UTC (permalink / raw)
  To: Dingjun Chen; +Cc: gcc-help

[-- Attachment #1: Type: text/plain, Size: 4652 bytes --]

On Fri, 13 Oct 2023, 16:01 Dingjun Chen, <Dingjun.Chen@geotechairborne.com>
wrote:

> Hi, guys,
>
> I am trying to build gcc-3.3.6 from Index of
> /mirrors/gcc/releases/gcc-3.3.6 (bigsearcher.com)<
> https://bigsearcher.com/mirrors/gcc/releases/gcc-3.3.6/> ,
> the following error message occurred. Could you please tell me how to fix
> it?
>
> My host computer: Dell Inspiron 16 plus 7630.
> GCC on host: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
> under WSL.
>
> Why do I want to build gcc-3.3.6? because I want to use it to build Linux
> Kernel 2.4.36. It was requested to build Linux Kernel 2.4.36 with the GCC
> version < 4.2. (please see:
> home/dingjun/build_cross_gcc/linux-2.4.36/include/linux/compiler.h:45:2:
> error: #error "GCC >= 4.2 miscompiles kernel 2.4, do not use it!"
>    45 | #error "GCC >= 4.2 miscompiles kernel 2.4, do not use it!")
>
>
> I tried several gcc version (<4.2) and almost each one has some errors.
> Could you some tell me which gcc(<4.2 version) source codes are 100% sure
> to be built without errors?
>

I expect that none of the ancient versions will build without errors using
modern compilers. Modern compilers are stricter and reject code that was
accepted in ancient times.

It looks like the error below is in the fortran compiler. If you don't need
Fortran and other languages, disable them with --enable-languages=c to only
build a C compiler.





> Thanks & regards,
>
> Dingjun
>
>
> /***** an error occurred when building gcc-3.3.6************/
> In file included from ./config.h:17,
>                  from f/proj.h:30,
>                  from f/com.c:83:
> ./tree.h:2244:55: note: expected ‘const char *’ but argument is of type
> ‘unsigned char *’
>  2244 | extern tree build_string                PARAMS ((int, const char
> *));
>       |                                                       ^~~~~~~~~~~~
> ./../include/ansidecl.h:152:33: note: in definition of macro ‘PARAMS’
>   152 | #define PARAMS(ARGS)            ARGS
>       |                                 ^~~~
> f/com.c: At top level:
> f/com.c:11079:1: error: conflicting types for ‘ffecom_gfrt_basictype’;
> have ‘ffeinfoBasictype(ffecomGfrt)’
> 11079 | ffecom_gfrt_basictype (ffecomGfrt gfrt)
>       | ^~~~~~~~~~~~~~~~~~~~~
> In file included from f/com.c:124:
> f/com.h:236:17: note: previous declaration of ‘ffecom_gfrt_basictype’ with
> type ‘ffeinfoKindtype(ffecomGfrt)’
>   236 | ffeinfoKindtype ffecom_gfrt_basictype (ffecomGfrt ix);
>       |                 ^~~~~~~~~~~~~~~~~~~~~
> f/com.c: In function ‘ffecom_init_0’:
> f/com.c:11624:28: warning: comparison between ‘ffeinfoKindtype’ and ‘enum
> <anonymous>’ [-Wenum-compare]
> 11624 |   if (ffecom_pointer_kind_ == FFEINFO_basictypeNONE)
>       |                            ^~
> In file included from f/com.c:16573:
> ./gt-f-com.h: In function ‘gt_ggc_mx_lang_tree_node’:
> ./gt-f-com.h:65:7: warning: switch condition has boolean value
> [-Wswitch-bool]
>    65 |       switch (TREE_CODE (&((*x)).generic) == IDENTIFIER_NODE)
>       |       ^~~~~~
> f/com.c: In function ‘ffe_mark_addressable’:
> f/com.c:14300:9: warning: this statement may fall through
> [-Wimplicit-fallthrough=]
> 14300 |         put_var_into_stack (x, /*rescan=*/true);
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> f/com.c:14303:7: note: here
> 14303 |       case FUNCTION_DECL:
>       |       ^~~~
> f/com.c:14304:30: warning: this statement may fall through
> [-Wimplicit-fallthrough=]
> 14304 |         TREE_ADDRESSABLE (x) = 1;
> f/com.c:14310:7: note: here
> 14310 |       default:
>       |       ^~~~~~~
> make[1]: *** [Makefile:735: f/com.o] Error 1
> make[1]: Leaving directory '/home/dingjun/build_cross_gcc/gcc-3.3.6/gcc'
> make: *** [Makefile:1546: all-gcc] Error 2
> Dingjun Chen  | Software Developer
>
> [Geotech Airborne Geophysical Surveys]
>
> Geotech Ltd. dba Geotech Airborne | 270 INDUSTRIAL PKY S | AURORA ON CA |
> L4G 3T9
> T: +1 905 841 5004 | Dingjun.Chen@geotechairborne.com<mailto:
> Dingjun.Chen@geotechairborne.com> | www.geotechairborne.com<www.geotech.ca
> >
>
> P Please consider the environment before printing this email
>
> This message may contain PRIVILEGED AND PROPRIETARY INFORMATION intended
> solely for the use of the addressee (s) named above. Any disclosure,
> distribution, copying, or use of the information by others is strictly
> prohibited. If you have received this message in error, please advise the
> sender by immediate reply and delete the original message.
>

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

* Re: An error occurred when building gcc-3.3.6
  2023-10-13 15:29 ` Jonathan Wakely
@ 2023-10-13 15:39   ` Dingjun Chen
  2023-10-17 14:35     ` Andrew Haley
  0 siblings, 1 reply; 4+ messages in thread
From: Dingjun Chen @ 2023-10-13 15:39 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

[-- Attachment #1: Type: text/plain, Size: 5969 bytes --]

Hi again, Jonathan,


I configured gcc-3..3.6 with "./configure --enable-languages=c",

However, an error occurred and please see below. Could you tell me how to proceed and fix it?

Thanks,

Dingjun



./collect2.c: In function ‘error’:
./collect2.c:408:1: warning: traditional C rejects ISO C style function definitions [-Wtraditional]
  408 | error VPARAMS ((const char * msgid, ...))
      | ^~~~~
In file included from /usr/include/fcntl.h:314,
                 from ./system.h:208,
                 from ./collect2.c:30:
In function ‘open’,
    inlined from ‘collect_execute’ at ./collect2.c:1575:22:
/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:11: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments
   50 |           __open_missing_mode ();
      |           ^~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [Makefile:1331: collect2.o] Error 1

________________________________
From: Jonathan Wakely <jwakely.gcc@gmail.com>
Sent: Friday, October 13, 2023 11:29 AM
To: Dingjun Chen <Dingjun.Chen@geotechairborne.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: An error occurred when building gcc-3.3.6


External Email Warning: Do not click any links or open any attachments unless you trust the sender and know the content is safe. From Geotech IT.




On Fri, 13 Oct 2023, 16:01 Dingjun Chen, <Dingjun.Chen@geotechairborne.com<mailto:Dingjun.Chen@geotechairborne.com>> wrote:
Hi, guys,

I am trying to build gcc-3.3.6 from Index of /mirrors/gcc/releases/gcc-3.3.6 (bigsearcher.com<http://bigsearcher.com>)<https://bigsearcher.com/mirrors/gcc/releases/gcc-3.3.6/> ,
the following error message occurred. Could you please tell me how to fix it?

My host computer: Dell Inspiron 16 plus 7630.
GCC on host: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
under WSL.

Why do I want to build gcc-3.3.6? because I want to use it to build Linux Kernel 2.4.36. It was requested to build Linux Kernel 2.4.36 with the GCC version < 4.2. (please see: home/dingjun/build_cross_gcc/linux-2.4.36/include/linux/compiler.h:45:2: error: #error "GCC >= 4.2 miscompiles kernel 2.4, do not use it!"
   45 | #error "GCC >= 4.2 miscompiles kernel 2.4, do not use it!")


I tried several gcc version (<4.2) and almost each one has some errors. Could you some tell me which gcc(<4.2 version) source codes are 100% sure to be built without errors?

I expect that none of the ancient versions will build without errors using modern compilers. Modern compilers are stricter and reject code that was accepted in ancient times.

It looks like the error below is in the fortran compiler. If you don't need Fortran and other languages, disable them with --enable-languages=c to only build a C compiler.





Thanks & regards,

Dingjun


/***** an error occurred when building gcc-3.3.6************/
In file included from ./config.h:17,
                 from f/proj.h:30,
                 from f/com.c:83:
./tree.h:2244:55: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
 2244 | extern tree build_string                PARAMS ((int, const char *));
      |                                                       ^~~~~~~~~~~~
./../include/ansidecl.h:152:33: note: in definition of macro ‘PARAMS’
  152 | #define PARAMS(ARGS)            ARGS
      |                                 ^~~~
f/com.c: At top level:
f/com.c:11079:1: error: conflicting types for ‘ffecom_gfrt_basictype’; have ‘ffeinfoBasictype(ffecomGfrt)’
11079 | ffecom_gfrt_basictype (ffecomGfrt gfrt)
      | ^~~~~~~~~~~~~~~~~~~~~
In file included from f/com.c:124:
f/com.h:236:17: note: previous declaration of ‘ffecom_gfrt_basictype’ with type ‘ffeinfoKindtype(ffecomGfrt)’
  236 | ffeinfoKindtype ffecom_gfrt_basictype (ffecomGfrt ix);
      |                 ^~~~~~~~~~~~~~~~~~~~~
f/com.c: In function ‘ffecom_init_0’:
f/com.c:11624:28: warning: comparison between ‘ffeinfoKindtype’ and ‘enum <anonymous>’ [-Wenum-compare]
11624 |   if (ffecom_pointer_kind_ == FFEINFO_basictypeNONE)
      |                            ^~
In file included from f/com.c:16573:
./gt-f-com.h: In function ‘gt_ggc_mx_lang_tree_node’:
./gt-f-com.h:65:7: warning: switch condition has boolean value [-Wswitch-bool]
   65 |       switch (TREE_CODE (&((*x)).generic) == IDENTIFIER_NODE)
      |       ^~~~~~
f/com.c: In function ‘ffe_mark_addressable’:
f/com.c:14300:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
14300 |         put_var_into_stack (x, /*rescan=*/true);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
f/com.c:14303:7: note: here
14303 |       case FUNCTION_DECL:
      |       ^~~~
f/com.c:14304:30: warning: this statement may fall through [-Wimplicit-fallthrough=]
14304 |         TREE_ADDRESSABLE (x) = 1;
f/com.c:14310:7: note: here
14310 |       default:
      |       ^~~~~~~
make[1]: *** [Makefile:735: f/com.o] Error 1
make[1]: Leaving directory '/home/dingjun/build_cross_gcc/gcc-3.3.6/gcc'
make: *** [Makefile:1546: all-gcc] Error 2
Dingjun Chen  | Software Developer

[Geotech Airborne Geophysical Surveys]

Geotech Ltd. dba Geotech Airborne | 270 INDUSTRIAL PKY S | AURORA ON CA | L4G 3T9
T: +1 905 841 5004 | Dingjun.Chen@geotechairborne.com<mailto:Dingjun.Chen@geotechairborne.com><mailto:Dingjun.Chen@geotechairborne.com<mailto:Dingjun.Chen@geotechairborne.com>> | www.geotechairborne.com<http://www.geotechairborne.com><www.geotech.ca<http://www.geotech.ca>>

P Please consider the environment before printing this email

This message may contain PRIVILEGED AND PROPRIETARY INFORMATION intended solely for the use of the addressee (s) named above. Any disclosure, distribution, copying, or use of the information by others is strictly prohibited. If you have received this message in error, please advise the sender by immediate reply and delete the original message.

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

* Re: An error occurred when building gcc-3.3.6
  2023-10-13 15:39   ` Dingjun Chen
@ 2023-10-17 14:35     ` Andrew Haley
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Haley @ 2023-10-17 14:35 UTC (permalink / raw)
  To: gcc-help

On 10/13/23 16:39, Dingjun Chen wrote:
> I configured gcc-3..3.6 with "./configure --enable-languages=c",


Do not configure GCC in the source directory.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


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

end of thread, other threads:[~2023-10-17 14:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-13 15:00 An error occurred when building gcc-3.3.6 Dingjun Chen
2023-10-13 15:29 ` Jonathan Wakely
2023-10-13 15:39   ` Dingjun Chen
2023-10-17 14:35     ` Andrew Haley

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).