Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
244 Views

Failed to compile the MIT amalgamated gcc.c into a x86 ELF binary (internal error: 04010022_1238)

Jump to solution

The source code is at https://people.csail.mit.edu/smcc/projects/single-file-programs/gcc.c.bz2 

The icc version I used was v19.1.1.219

The command I used was: "icc gcc.c -O2 -m32 --save-temps -g -Wno-error -lm -o gcc"

The compilation failed because of: "gcc.c(660840) (col. 1): internal error: 04010022_1238"

 

I have tried targeting x64 ELF, and it did not have this problem.

By using "-O0" and "-O1" instead of -O2 for x86, the compilation did succeed.

 

The compilation was run under a clean x64 ubuntu 20.04 docker container with only intel-sw-tools and its dependencies installed. The host machine has 128G RAM.

Labels (1)
0 Kudos

Accepted Solutions
Highlighted
Moderator
182 Views

Hi,

Thanks for providing the suggestion and required details!

We are able to reproduce the issue on our end.

We are forwarding your issue to the concerned team.



Thanks & Regards

Goutham


View solution in original post

0 Kudos
4 Replies
Highlighted
Moderator
210 Views

Hi,

Thanks for reaching out to us!

We tried to reproduce the issue on Ubuntu 18.04, we are getting the following errors.


$ icc gcc.c -O2 -m32 --save-temps -g -Wno-error -lm -o gcc


gcc.c(50400): warning #47: incompatible redefinition of macro "__NO_STRING_INLINES"

 #define __NO_STRING_INLINES

     ^


In file included from /usr/include/features.h(448),

         from /usr/include/libintl.h(23),

         from gcc.c(1524):

/usr/include/x86_64-linux-gnu/gnu/stubs.h(7): catastrophic error: cannot open source file "gnu/stubs-32.h"

 # include <gnu/stubs-32.h>

              ^


compilation aborted for gcc.c (code 4)



However, we will test it on Ubuntu 20.04.

We working on your issue at our end, we will get back to you soon.



Thanks & Regards

Goutham


0 Kudos
Highlighted
Beginner
201 Views

It seems to me that the x86 version of libc is missing. Did you install "libc6-dev-i386" and "g++-multilib" in your system?

I have also posted the compiler installation part of the Dockerfile I used to for my investigation. Hope it can help you regenerate this error.

0 Kudos
Highlighted
Moderator
183 Views

Hi,

Thanks for providing the suggestion and required details!

We are able to reproduce the issue on our end.

We are forwarding your issue to the concerned team.



Thanks & Regards

Goutham


View solution in original post

0 Kudos
Highlighted
Moderator
148 Views

I've reported this bug to our Developer. Thanks,


0 Kudos