longsleep / build-pine64-image

Pine64 Linux build scripts, tools and instructions
MIT License
235 stars 126 forks source link

Question: How to resolve gcc5 issue building u-boot? #50

Closed g40 closed 7 years ago

g40 commented 7 years ago

@longsleep Very nice work, thank you. I am assembling a buildroot based system for the kernel and RFS but right now am having to do the u-boot part using your instructions. Host is ubuntu 16.04 and I've got both arm-linux-gnueabihf-gcc and arm-linux-gnueabihf-gcc-5 installed. When I run ~/br/pine64/u-boot-pine64$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- V=1 I end up with this:

arm-linux-gnueabihf-gcc -Wp,-MD,lib/.asm-offsets.s.d  -nostdinc -isystem /usr/lib/gcc-cross/arm-linux-gnueabihf/5/include -Iinclude  -I/home/jevans/br/pine64/u-boot-pine64/arch/arm/include -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-format-security -fno-builtin -ffreestanding -Os -fno-stack-protector -g -fstack-usage -Wno-format-nonliteral -Werror=date-time -march=armv7-a -Werror -mno-unaligned-access -DCONFIG_ARM -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -mword-relocations -ffunction-sections -fdata-sections -fno-common -ffixed-r9 -msoft-float -pipe -DDO_DEPS_ONLY    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(asm_offsets)"  -D"KBUILD_MODNAME=KBUILD_STR(asm_offsets)"  -fverbose-asm -S -o lib/asm-offsets.s lib/asm-offsets.c
In file included from include/linux/compiler.h:40:0,
                 from include/linux/byteorder/little_endian.h:12,
                 from /home/jevans/br/pine64/u-boot-pine64/arch/arm/include/asm/byteorder.h:29,
                 from include/compiler.h:112,
                 from include/image.h:19,
                 from include/common.h:94,
                 from lib/asm-offsets.c:15:
include/linux/compiler-gcc.h:93:30: fatal error: linux/compiler-gcc5.h: No such file or directory
compilation terminated

How do I get around this? I tried the update-alternatives mechanism but that was an epic fail. Your help would be much appreciated.

longsleep commented 7 years ago

Something seems to be wrong with your u-boot tree. Make sure that you use https://github.com/longsleep/u-boot-pine64/tree/pine64-hacks/ - that tree has been fixed for gcc5 9 months ago and for gcc6 3 months ago.

g40 commented 7 years ago

Thanks for the super fast reply! You are right, I had the wrong branch checked out. Cheers.

hari275 commented 7 years ago

i have the same issue can you please guide me to solve it????

g40 commented 7 years ago

@hari275 do you have the correct branch checked out?

hari275 commented 7 years ago

Sorry, I'm unaware of it I'm actually very new to it! I couldn't compile using "make" popping out very similar to this, in Ubuntu 16 . I'm trying to build using bsp of banana pi. Thank you for this quick response😀

g40 commented 7 years ago

@hari275 It will help you enormously to get GIT basics ASAP. Open a shell in the repo directory, then git status

On branch pine64-hacks
Your branch is up-to-date with 'origin/pine64-hacks'.
nothing to commit, working directory clean

If the branch is master then you need to

git checkout pine64-hacks to get the right branch. Then, to ensure you are up to date with this repo, git pull

Good luck.

hari275 commented 7 years ago

Thank you!! Will try it tomorrow.

On Jun 23, 2017 9:47 PM, "Jerry Evans" notifications@github.com wrote:

@hari275 https://github.com/hari275 It will help you enormously to get GIT basics ASAP. Open a shell in the repo directory, then git status

On branch pine64-hacks Your branch is up-to-date with 'origin/pine64-hacks'. nothing to commit, working directory clean

If the branch is master then you need to

git checkout pine64-hacks to get the right branch. Then, to ensure you are up to date with this repo, git pull

Good luck.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/longsleep/build-pine64-image/issues/50#issuecomment-310709110, or mute the thread https://github.com/notifications/unsubscribe-auth/AcSRRa7bpVI5cW4hcG5Mj5dFGYKG17mcks5sG-UKgaJpZM4MW5ST .

sravanianattala commented 6 years ago

Hi, i am sravani. i am doing uboot building on ubuntu 16.04.when i was ran the command ''make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-'' it shows me fatal error of gcc i.e fatal error: linux/compiler-gcc5.h: No such file or directory and the compilation terminated anything wrong with compiler? or else? please tell me the solution?i have to submit my post graduation project.

sravanianattala commented 6 years ago

screenshot from 2018-07-10 12-19-12