Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation on Ubuntu 22.04 LTS #1

Open
myfingerhurt opened this issue Apr 24, 2023 · 1 comment
Open

Compilation on Ubuntu 22.04 LTS #1

myfingerhurt opened this issue Apr 24, 2023 · 1 comment

Comments

@myfingerhurt
Copy link

myfingerhurt commented Apr 24, 2023

OS: ubuntu 22.04 LTS Server
uboot 2017.11

I tried using the 2019.04 version, and although there were no compilation problems, I couldn't get it to run. Since I didn't know how to fix the issue, I decided to address the compilation problem in the 2017.11 version instead.

  • pit 1. no config
    sudo apt-get install -y bison flex
    make socfpga_de10_nano_defconfig

  • pit 2. no gcc
    apt-get install crossbuild-essential-armhf

  • pit 3. cc1: error: bad value (‘generic-armv7-a’) for ‘-mtune=’ switch
    export ARCH=arm;export CROSS_COMPILE=arm-linux-gnueabihf-
    or
    make V=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

  • pit 4. tc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here

        $ nano scripts/dtc/dtc-lexer.lex.c
              //YYLTYPE yylloc;
              extern YYLTYPE yylloc;
  • pit 5. arm-linux-gnueabihf-gcc: error: unrecognized -march target: armv5
    this took me 2-days to solve, if you did armv7 or armv5t it would give you something like this.
              arch/arm/cpu/armv7/cache_v7.c
              {standard input}:35: Error: selected processor does not support `mcr p15,0,r3,c7,c5,0' in Thumb mode

Since the Altera socfpga is Cortex-A9, so armv7-a is the correct choice.

        nano .\arch\arm\Makefile
              # Replace
              # arch-$(CONFIG_CPU_V7) =$(call cc-option, -march=armv7-a, \
              #                   $(call cc-option, -march=armv7, -march=armv5))
              arch-$(CONFIG_CPU_V7) =$(call cc-option, -march=armv7-a, \
                                      $(call cc-option, -march=armv7-a, -march=armv7-a))

At this point, you should be able to pass the compilation.

@ikwzm
Copy link
Owner

ikwzm commented Apr 24, 2023

Thanks for your valuable information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants