OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 11:09 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: RPi: aarch64-none-elf-gcc: fatal error: cannot execute 'cc1'
PostPosted: Wed Jun 09, 2021 6:33 pm 
Offline
User avatar

Joined: Wed Jun 09, 2021 2:25 pm
Posts: 6
Hello I have been trying to compile my raspberry pi 4 OS for a long time but I think I'm close to getting it work.
Anyways I keep getting this error when ever trying to build:

Code:
aarch64-none-elf-gcc: fatal error: cannot execute 'cc1': execvp: Permission denied


I've tried to add:
Code:
-print-prog-name=cc1

But it still doesn't work.

Here's the makefile:
Code:
PROJECT_DIR= ../
CSRCFLAGS= -O2 -Wall -Wextra
LFLAGS= -ffreestanding -O2 -nostdlib
IMG_PATH= ../
BUILD_BACK_TWO= ../../../build
CFILES= $(wildcard *.c)
OFILES= $(CFILES:.c=.o)
GCCPATH= gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf
CFLAGSSTART= -ffreestanding -c
CFLAGSEND= -O2 -Wall -Wextra
GCCFLAGS= -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles
GCCPATHAARCH= $(GCCPATH)/aarch64-none-elf/bin
GCCPATHBIN= $(GCCPATH)/bin
ASMCFLAGS= -f elf32 -F dwarf -g -w+all
ASM= -s

# Location of the files
THIS_DIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
KER_SRC = $(PROJECT_DIR)/src/kernel
KER_MENU_SRC = $(PROJECT_DIR)/src/kernel/menu
KER_HEAD = $(PROJECT_DIR)/include
COMMON_SRC = $(PROJECT_DIR)/src/common
UI_IMAGES = $(PROJECT_DIR)/images/ui
SPE_GAMES = ../spe_games
DINOBYTE = $(SPE_GAMES)/dinobyte
OBJ_DIR = $(PROJECT_DIR)/build/objects
ASMSOURCES = $(wildcard $(KER_SRC)/*.s)
KERSOURCES = $(wildcard $(KER_SRC)/*.c)
#KERSOURCES = $(wildcard $(KER_SRC)/$(ARCHDIR)/*.c)
COMMONSOURCES = $(wildcard $(COMMON_SRC)/*.c)
KERSOURCESCPP = $(wildcard $(KER_SRC)/*.cpp)
DINOBYTESOURCES = $(wildcard $(DINOBYTE)/src/*.cpp)
#KERSOURCESCPP = $(wildcard $(KER_SRC)/$(ARCHDIR)/*.cpp)
#KERMENUSOURCESC = $(wildcard $(KER_MENU_SRC)/*.c)
#KERMENUSOURCESCPP = $(wildcard $(KER_MENU_SRC)/*.cpp)
UISOURCES = $(wildcard $(UI_IMAGES)/*.png)
OBJECTS = $(patsubst $(KER_SRC)/%.s, $(OBJ_DIR)/%.o, $(ASMSOURCES))
#OBJECTS += $(patsubst $(KER_SRC)/%.s, $(OBJ_DIR)/%.o, $(ASMSOURCES))
OBJECTS += $(patsubst $(KER_SRC)/%.c, $(OBJ_DIR)/%.o, $(KERSOURCES))
OBJECTS += $(patsubst $(KER_SRC)/%.cpp, $(OBJ_DIR)/%.o, $(KERSOURCESCPP))
OBJECTS += $(patsubst $(COMMON_SRC)/%.c, $(OBJ_DIR)/%.o, $(COMMONSOURCES))
#OBJECTS += $(patsubst $(KER_MENU_SRC)/%.c, $(OBJ_DIR)/%.o, $(KERMENUSOURCESC))
#OBJECTS += $(patsubst $(KER_MENU_SRC)/%.cpp, $(OBJ_DIR)/%.o, $(KERMENUSOURCESCPP))
#OBJECTS += $(patsubst $(UI_IMAGES)/%.png, $(OBJ_DIR)/%.o, $(UISOURCES))

#Dinobyte objects [include Dinobyte headers here] (do later)
#OBJECTS += $(patsubst $(DINOBYTESOURCES)/src/%.cpp, $(OBJ_DIR)/%.o, $(DINOBYTESOURCES))

#Headers
HEADERS = $(wildcard $(KER_HEAD)/*.h)


IMG_NAME=SuperPiOS

#build: $(OBJECTS) $(HEADERS)
#$(CC) -T linker.ld -o $(IMG_NAME).elf $(LFLAGS) $(OBJECTS) #needs indent
#$(OBJCOPY) $(IMG_NAME).elf -O binary $(IMG_NAME).img #needs indent

#$(OBJ_DIR)/%.o: $(KER_SRC)/%.s
#mkdir -p $(@D) #needs indent
#$(CC) $(CFLAGS) -I$(KER_SRC) -c $< -o $@ #needs indent


#$(OBJ_DIR)/%.o: $(KER_MENU_SRC)/%.c
#   mkdir -p $(@D)
#   $(CC) $(CFLAGS) -I$(KER_SRC) -I$(KER_HEAD) -c $< -o $@ $(CSRCFLAGS)

#$(OBJ_DIR)/%.o: $(KER_MENU_SRC)/%.cpp
#   mkdir -p $(@D)
#   $(CC) $(CXXFLAGS) -I$(KER_SRC) -I$(KER_HEAD) -c $< -o $@ $(CSRCFLAGS)

$(OBJ_DIR)/%.o: $(KER_SRC)/%.s
   mkdir -p $(@D)
   @echo !==== COMPILING $^
   $(GCCPATHBIN)/aarch64-none-elf-as -c $^ -o $@
$(OBJ_DIR)/%.o: $(KER_SRC)/%.c
   mkdir -p $(@D)
   @echo !==== COMPILING $^
   $(GCCPATHBIN)/aarch64-none-elf-gcc -ffreestanding -c $^ -o $@ -O2 -Wall -Wextra
$(OBJ_DIR)/%.o: $(KER_SRC)/$(ARCHDIR)/%.c
   mkdir -p $(@D)
   @echo !==== COMPILING $^
   $(GCCPATHBIN)/aarch64-none-elf-gcc -ffreestanding -c $^ -o $@ -O2 -Wall -Wextra
$(OBJ_DIR)/%.o: $(KER_SRC)/%.cpp
   mkdir -p $(@D)
   @echo !==== COMPILING $^
   $(GCCPATHBIN)/aarch64-none-elf-gcc -ffreestanding -c $^ -o $@ -O2 -Wall -Wextra
$(OBJ_DIR)/%.o: $(KER_SRC)/$(ARCHDIR)/%.cpp
   mkdir -p $(@D)
   @echo !==== COMPILING $^
   $(GCCPATHBIN)/aarch64-none-elf-gcc -ffreestanding -c $^ -o $@ -O2 -Wall -Wextra
$(OBJ_DIR)/%.o: $(COMMON_SRC)/%.c
   mkdir -p $(@D)
   @echo !==== COMPILING $^
   $(GCCPATHBIN)/aarch64-none-elf-gcc -ffreestanding -c $^ -o $@ -O2 -Wall -Wextra -cc1

BUILD: $(OBJECTS) $(HEADERS)
   mkdir -p $(@D)
   @echo !==== COMPILING $^
   $(GCCPATHBIN)/aarch64-none-elf-ld -nostdlib -nostartfiles $(OBJECTS) -T linker.ld -o $(IMG_NAME).elf
   $(GCCPATHBIN)/aarch64-none-elf-objcopy -O binary $(IMG_NAME).elf  $(IMG_NAME).img


clean:
   rm -rf $(OBJ_DIR)
   rm $(IMG_NAME).elf
   rm $(IMG_NAME).img

#run: build
#   qemu-system-arm -m 128 -no-reboot -M raspi4 -serial stdio -kernel kernel.elf

#dbg:
#$(GDB) kernel.elf

#dbgrun: build gdbinit
#qemu-system-arm -m 128 -no-reboot -M raspi4 -serial stdio -kernel kernel.elf -S -s

start:
   @echo Starting
   mkdir $(OBJ_DIR)
   @echo .
   @echo .
   @echo .

.PHONY: start BUILD clean


If you can help please do.
Thanks in advance.

_________________
-Sam()
Code:
{
    Programmer();
}


Top
 Profile  
 
 Post subject: Re: RPi: aarch64-none-elf-gcc: fatal error: cannot execute '
PostPosted: Wed Jun 09, 2021 8:41 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
Sammyueru wrote:
Anyways I keep getting this error when ever trying to build:

You probably need to use chmod to fix the permissions on cc1.

Sammyueru wrote:
I've tried to add:

That flag will tell you where cc1 is. That flag does not fix anything by itself. Once you know where cc1 is, you can use chmod to fix the permissions.

Sammyueru wrote:
But it still doesn't work.

Please don't add color to your text. It's difficult to read.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: 8infy, Bing [Bot] and 55 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group