Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
7569 Discussions

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

Kaiyuan
Beginner
681 Views

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
1 Solution
GouthamK_Intel
Moderator
619 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

5 Replies
GouthamK_Intel
Moderator
647 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


Kaiyuan
Beginner
638 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.

GouthamK_Intel
Moderator
620 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

Viet_H_Intel
Moderator
585 Views

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


Viet_H_Intel
Moderator
177 Views

Hi,


Our developer has decided not to fix this bug. Hence I am going to close this thread.


Thanks,


Reply