3

I'm trying to install an older version of gcc-4enter code here for my ubuntu Make a build directory ( mkdir gcc-build && cd gcc-build) Download the source file: wget http://www.netgull.com/gcc/releases/gcc-4.8.0/gcc-4.8.0.tar.bz2 (adjust this command to use an appropriate mirror site. Unzip the file (tar -xvjf ) Install some additional libraries (sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev libc6-dev) Compile the source: ./gcc-4.8.0/configure --prefix=/app/gcc/4.8.0 Run make (This will take some time to complete. Go make some coffee, or bake some cookies. ;-)) Install the code: sudo make install

CPU architecture

lscpu
Architecture:                    aarch64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
CPU(s):                          16
On-line CPU(s) list:             0-15
Thread(s) per core:              1
Core(s) per socket:              4
Socket(s):                       4
NUMA node(s):                    1
Vendor ID:                       ARM
Model:                           3
Model name:                      Cortex-A72
Stepping:                        r0p3
BogoMIPS:                        166.66
L1d cache:                       512 KiB
L1i cache:                       768 KiB
L2 cache:                        8 MiB
NUMA node0 CPU(s):               0-15
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1:        Mitigation; __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Branch predictor hardening
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid

and finally run the sudo make install got this error

    make[1]: Entering directory '/home/ubuntu/gcc-build'
/bin/bash ./gcc-4.8.0/mkinstalldirs /app/gcc/4.8.0 /app/gcc/4.8.0
/bin/bash: line 3: cd: ./fixincludes: No such file or directory
make[1]: *** [Makefile:3405: install-fixincludes] Error 1
make[1]: Leaving directory '/home/ubuntu/gcc-build'
make: *** [Makefile:2196: install] Error 2

how can I fix this issue

Jerald Jacob
  • 77
  • 2
  • 10
  • Try running `./configure && make` in the top-level gcc source directory. – n. m. could be an AI Aug 26 '20 at 08:38
  • @n. 'pronouns' m. but issue still remain configure: error: C++ compiler missing or inoperational make[2]: *** [Makefile:7573: configure-stage1-libcpp] Error 1 make[2]: Leaving directory '/home/ubuntu/downlods/gcc-4.8.1' make[1]: *** [Makefile:18649: stage1-bubble] Error 2 make[1]: Leaving directory '/home/ubuntu/downlods/gcc-4.8.1' make: *** [Makefile:883: all] Error 2 – Jerald Jacob Aug 26 '20 at 10:21
  • This is a different issue. Do you have some other version of gcc installed? – n. m. could be an AI Aug 26 '20 at 10:32
  • I'm installed gcc-9 for the compilation, I need to install multiple GCC on a single machine . I have to compile the goldfish kernel. it only support the gcc-3 to 4. @n. 'pronouns' m. – Jerald Jacob Aug 26 '20 at 11:45

1 Answers1

4

Hope you have updated package manager, in doubt you can run following commands (in the same order given, which should run without errors):

sudo apt-get update
sudo apt-get upgrade

Then you need to ensure build-essential installed:

sudo apt-get install build-essential

After that you can install required version of gcc (example: gcc-4):

sudo apt-get install gcc-4

Now the part of selecting specific version of gcc by following command:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4 4
sudo update-alternatives --config gcc

By this way you can switch between multiple versions of gcc too. The second command in the last step will give you a menu like option to select among available(installed) gcc versions to be set.

Mithun B
  • 268
  • 1
  • 8