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

permission denied error? #128

Closed
Fledge68 opened this issue Mar 4, 2020 · 5 comments
Closed

permission denied error? #128

Fledge68 opened this issue Mar 4, 2020 · 5 comments

Comments

@Fledge68
Copy link

Fledge68 commented Mar 4, 2020

I'm on windows 10.
I downloaded and installed latest devkitppc r35-2 and libogc 1.8.23 using devkitpro updater.
then using msys2 I downloaded and installed some portlibs (freetype, libpng, libjpegturbo, libtremor)
I'm trying to compile wiiflow v5.4.1.
i removed the same libs from wiiflow's portlibs folder.
and made some changes to wiiflow's makefile.main which is wiiflow's main makefile.

wiiflow compiles fine but linking doesn't work. I get the following error:

linking ... boot.elf
c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/8.3.0/../../../../powerpc-eabi/bin/ld.exe: cannot find C:/devkitPro/portlibs/ppc: Permission denied
collect2.exe: error: ld returned 1 exit status
make[2]: *** [/opt/devkitpro/devkitPPC/wii_rules:30: /c/sources/wiiflow5/WiiFlow_Lite/out/boot.elf] Error 1
make[1]: *** [/c/sources/wiiflow5/WiiFlow_Lite/Makefile.main:142: build] Error 2
make: *** [Makefile:15: all] Error 2

Here's makefile.main. maybe something's wrong in it.

#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
endif

include $(DEVKITPPC)/wii_rules
#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
#---------------------------------------------------------------------------------
TARGET		:=	boot
BUILD		:=	build
SOURCES		:=	source \
				source/booter \
				source/banner \
				source/channel \
				source/cheats \
				source/config \
				source/data \
				source/devicemounter \
				source/fileOps \
				source/gc \
				source/gecko \
				source/gui \
				source/hw \
				source/homebrew \
				source/libwbfs \
				source/list \
				source/loader \
				source/memory \
				source/menu \
				source/music \
				source/network \
				source/plugin \
				source/sicksaxis-wrapper \
				source/unzip \
				source/xml \
				source/wstringEx
DATA		:=	data \
				data/images \
				data/help \
				data/sounds
INCLUDES	:=	source

#---------------------------------------------------------------------------------
# Default build shell script options
#---------------------------------------------------------------------------------
ios			:=	249
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
CFLAGS		=	-g -ggdb -O2 -Wall -Wextra $(MACHDEP) $(INCLUDE) -D_GNU_SOURCE -DHAVE_CONFIG_H `freetype-config --cflags`
CXXFLAGS	=	$(CFLAGS)
LDFLAGS		=	-g -ggdb $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.init=0x80620000,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,malloc_usable_size,-wrap,wiiuse_register

ifeq ($(BUILDMODE),channel)
CFLAGS += -DFULLCHANNEL
CXXFLAGS += -DFULLCHANNEL
endif

#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS	:=	`freetype-config --libs` -lwolfssl -lcustomfat -lcustomntfs -lcustomext2fs -lpng -lturbojpeg -lm -lz -lwiiuse -lwupc -lwiidrc -lbte -lasnd -logc -lfreetype -lvorbisidec -lmad -lsicksaxis

#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS	:=	$(PORTLIBS) $(CURDIR)/portlibs
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export PROJECTDIR := $(CURDIR)
export OUTPUT	:=	$(CURDIR)/$(TARGETDIR)/$(TARGET)
export VPATH	:=	$(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
					$(foreach dir,$(DATA),$(CURDIR)/$(dir))
export DEPSDIR	:=	$(CURDIR)/$(BUILD)

#---------------------------------------------------------------------------------
# automatically build a list of object files for our project
#---------------------------------------------------------------------------------
export CFILES	:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
export CPPFILES	:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
sFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
SFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
ELFFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.elf)))
BINFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.bin)))
TTFFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.ttf)))
PNGFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.png)))
OGGFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.ogg)))
WAVFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.wav)))
DOLFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.dol)))
TXTFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.txt)))
JPGFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.jpg)))

#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
	export LD	:=	$(CC)
else
	export LD	:=	$(CXX)
endif

export OFILES	:=	$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
					$(sFILES:.s=.o) $(SFILES:.S=.o) \
					$(PNGFILES:.png=.png.o) $(JPGFILES:.jpg=.jpg.o) \
					$(OGGFILES:.ogg=.ogg.o) $(TXTFILES:.txt=.txt.o) \
					$(WAVFILES:.wav=.wav.o) $(addsuffix .o,$(BINFILES))

#---------------------------------------------------------------------------------
# build a list of include paths
#---------------------------------------------------------------------------------
export INCLUDE	:=	$(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
					$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
					-I$(CURDIR)/$(BUILD) -I$(LIBOGC_INC)

#---------------------------------------------------------------------------------
# build a list of library paths
#---------------------------------------------------------------------------------
export LIBPATHS	:=	$(foreach dir,$(LIBDIRS),-L$(dir)/lib) -L$(CURDIR)/source/libs/libfat/ \
					-L$(CURDIR)/source/libs/libntfs/ -L$(CURDIR)/source/libs/libext2fs/ \
					-L$(CURDIR)/source/libwolfssl/ -L$(LIBOGC_LIB)/ -L$(PORTLIBS)

export OUTPUT	:=	$(CURDIR)/out/$(TARGET)
.PHONY: $(BUILD) all clean

#---------------------------------------------------------------------------------
$(BUILD):
	@[ -d $@ ] || mkdir -p $@
	@bash ./scripts/buildtype.sh $(ios)
	@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.main

#---------------------------------------------------------------------------------
all:
	@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.main

#---------------------------------------------------------------------------------
clean:
	@echo clean ...
	@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol \
		$(CURDIR)/source/loader/alt_ios_gen.h $(CURDIR)/out/bins/ext_loader.bin \
		$(CURDIR)/out/bins/ext_booter.bin $(CURDIR)/out/bins/app_booter.bin

#---------------------------------------------------------------------------------
else

DEPENDS	:=	$(OFILES:.o=.d)

#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).dol: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)

#---------------------------------------------------------------------------------
# This rule links in binary data with .ttf, .png, and .mp3 extensions
#---------------------------------------------------------------------------------

%.png.o : %.png
	@echo $(notdir $<)
	@bin2s -a 32 $< | $(AS) -o $(@)

%.ogg.o : %.ogg
	@echo $(notdir $<)
	@bin2s -a 32 $< | $(AS) -o $(@)

%.wav.o : %.wav
	@echo $(notdir $<)
	@bin2s -a 32 $< | $(AS) -o $(@)

%.bin.o	:	%.bin
	@echo $(notdir $<)
	@bin2s -a 32 $< | $(AS) -o $(@)

%.txt.o	:	%.txt
	@echo $(notdir $<)
	@bin2s -a 32 $< | $(AS) -o $(@)
	
%.jpg.o	:	%.jpg
	@echo $(notdir $<)
	@bin2s -a 32 $< | $(AS) -o $(@)

export PATH		:=	$(PROJECTDIR)/gettext-bin:$(PATH)

-include $(DEPENDS)

#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
@Fledge68
Copy link
Author

fixed it myself.

@WinterMute
Copy link
Member

Do you use Discord by any chance?

WiiFlow is going to need a lot of work to compile properly, some of which will improve the packages for anyone else. I can help a bit but obviously issue trackers aren't really the best way to do it.

@Fledge68
Copy link
Author

Fledge68 commented Mar 11, 2020

it's ok. i figured it out. just took me a while to find the devkitpro pages with all the info and a little more time figuring out what the pages meant.

@WinterMute
Copy link
Member

WinterMute commented Mar 11, 2020

@Fledge68 It's not OK though, there are immense issues with people compiling random things and shoving them into the devkitpro folder with inappropriate patching that interferes with other libraries. Some of the libraries being used here would have been better PR'd to libogc rather than being separate things. Others include headers which will prevent future planned improvements.

Don't get me wrong, doing the work to get things working with recent tools and packages is very much appreciated. Things could be a lot better though.

@Fledge68
Copy link
Author

ok i get that. i didn't tell anyone to shove their portlibs into devkitpro portlibs. I merely referenced your wiki pages that tell how to download devkitpro's portlibs with msys2 and pacman.

how would i have PR'd to libogc? like i said i was merely following your directions for downloading portlibs via pacman and adding the appropriate lines to the makefile.

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