Hacking [Issue] Compiling libz.a issue

ScarletDreamz

[Debug Mode]
OP
Member
Joined
Feb 16, 2015
Messages
3,967
Trophies
1
Location
/dev/sda1
XP
4,380
Country
United States
Hello,

Im trying to compile libz.a, and i managed to do it at my house, this time, im working on a new computer, and set up the DEV Environment as usual, here, this is my PATH config:
PATH=D:\3DS\ImageMagick;D:\3DS\DevStuff\msys\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live
;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Skype\Phone\;C:\Python27;D:\3DS\DevStuff\de
vkitARM\bin;D:\3DS\Git\cmd;D:\3DS\CMake\bin;D:\3DS\DevStuff\devkitARM\arm-none-eabi\bin;D:\3DS\MinGW;D:\3DS\MinGW\bin;D:\3DS\CMake\bin

However, when y tri to compile libz.a in order to compile CTRBootManager [Wich i already compiled at my home], i get this error:
make[1]: Entering directory `/d/3DS/Sources/ZLIB/zlib-1.2.8'
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I. -c -o example.o test/example.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I/D/3DS/DevStuff/portlibs/armv6k/include -c -o adler32.o adler32.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I/D/3DS/DevStuff/portlibs/armv6k/include -c -o crc32.o crc32.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I/D/3DS/DevStuff/portlibs/armv6k/include -c -o deflate.o deflate.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I/D/3DS/DevStuff/portlibs/armv6k/include -c -o infback.o infback.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I/D/3DS/DevStuff/portlibs/armv6k/include -c -o inffast.o inffast.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I/D/3DS/DevStuff/portlibs/armv6k/include -c -o inflate.o inflate.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I/D/3DS/DevStuff/portlibs/armv6k/include -c -o inftrees.o inftrees.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I/D/3DS/DevStuff/portlibs/armv6k/include -c -o trees.o trees.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I/D/3DS/DevStuff/portlibs/armv6k/include -c -o zutil.o zutil.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I/D/3DS/DevStuff/portlibs/armv6k/include -c -o compress.o compress.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I/D/3DS/DevStuff/portlibs/armv6k/include -c -o uncompr.o uncompr.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I/D/3DS/DevStuff/portlibs/armv6k/include -c -o gzclose.o gzclose.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I/D/3DS/DevStuff/portlibs/armv6k/include -c -o gzlib.o gzlib.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I/D/3DS/DevStuff/portlibs/armv6k/include -c -o gzread.o gzread.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I/D/3DS/DevStuff/portlibs/armv6k/include -c -o gzwrite.o gzwrite.c
arm-none-eabi-ar rc libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -o example example.o -L. libz.a
d:/3ds/devstuff/devkitarm/bin/../lib/gcc/arm-none-eabi/5.3.0/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol _start; defaulting to 00008020
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I. -c -o minigzip.o test/minigzip.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -o minigzip minigzip.o -L. libz.a
d:/3ds/devstuff/devkitarm/bin/../lib/gcc/arm-none-eabi/5.3.0/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol _start; defaulting to 00008020
make[1]: Leaving directory `/d/3DS/Sources/ZLIB/zlib-1.2.8'

D:\3DS\Sources\ZLIB>

TLDR; this is the issue:

d:/3ds/devstuff/devkitarm/bin/../lib/gcc/arm-none-eabi/5.3.0/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol _start; defaulting to 00008020
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -I. -c -o minigzip.o test/minigzip.c
arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O3 -mword-relocations -ffunction-sections -DHAVE_HIDDEN -o minigzip minigzip.o -L. libz.a
d:/3ds/devstuff/devkitarm/bin/../lib/gcc/arm-none-eabi/5.3.0/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol _start; defaulting to 00008020
make[1]: Leaving directory `/d/3DS/Sources/ZLIB/zlib-1.2.8'

this issue did not happen when compiling at my house, it worked flawlesly, and BTE, no i dont want to us eprecompiled stuff, since i want to learn how to do it from scratch, and i wanna know why at my home it did compile and here it dosnt, :/

i know there are precompiled libraries and stuff to just copy paste, but please understand, BTW im using the script from here: https://github.com/devkitPro/3ds_portlibs

and running Make Download, and Make zlib and neither do work :/ i got that error QQ.

Note: as a note, it appears that libz.a its generated on the source directory, but its not moved where the devkitarm directory is, and neither the libconfig file its generated.
 
Last edited by ScarletDreamz,

ScarletDreamz

[Debug Mode]
OP
Member
Joined
Feb 16, 2015
Messages
3,967
Trophies
1
Location
/dev/sda1
XP
4,380
Country
United States
Umm all i see is 2 warnings, that's it. What's the problem? :blink:
If i remember correctly, the script from portlibs, supposed to create the path on the DevKit directory.

export PATH := $(DEVKITARM)/bin:$(PORTLIBS_PATH)/3ds/bin:$(PORTLIBS_PATH)/armv6k/bin:$(PATH)

But it doe snot generate nor copy the file in that directory with the other files needed.
 

Shadowtrance

Well-Known Member
Member
Joined
May 9, 2014
Messages
2,493
Trophies
0
Location
Hervey Bay, Queensland
XP
1,807
Country
If i remember correctly, the script from portlibs, supposed to create the path on the DevKit directory.

export PATH := $(DEVKITARM)/bin:$(PORTLIBS_PATH)/3ds/bin:$(PORTLIBS_PATH)/armv6k/bin:$(PATH)

But it doe snot generate nor copy the file in that directory with the other files needed.
Umm did you use the "make install" command as it says on the portlibs page?
 

ScarletDreamz

[Debug Mode]
OP
Member
Joined
Feb 16, 2015
Messages
3,967
Trophies
1
Location
/dev/sda1
XP
4,380
Country
United States
Yeah, i tried make install-zlib and tough i got this:

D:\3DS\Sources\ZLIB>make install-zlib
make[1]: Entering directory `/d/3DS/Sources/ZLIB/zlib-1.2.8'
cp libz.a /portlibs/armv6k/lib
chmod 644 /portlibs/armv6k/lib/libz.a
cp zlib.3 /portlibs/armv6k/share/man/man3
chmod 644 /portlibs/armv6k/share/man/man3/zlib.3
cp zlib.pc /portlibs/armv6k/lib/pkgconfig
chmod 644 /portlibs/armv6k/lib/pkgconfig/zlib.pc
cp zlib.h zconf.h /portlibs/armv6k/include
chmod 644 /portlibs/armv6k/include/zlib.h /portlibs/armv6k/include/zconf.h
make[1]: Leaving directory `/d/3DS/Sources/ZLIB/zlib-1.2.8'


it doe snot generate the directory :/ wich si weird, because i dont remember doing this at my house, i remember doing make zlib and the script generated everything.
 

ScarletDreamz

[Debug Mode]
OP
Member
Joined
Feb 16, 2015
Messages
3,967
Trophies
1
Location
/dev/sda1
XP
4,380
Country
United States
It would be useful if you posted the solution, in case anybody else faces the same problem. Also, you could've probably used this precompiled portlibs version from xerpi: https://github.com/xerpi/3ds_portlibs/releases

Thank you, i already saw those, however, i dont like to use precompiled stuff, i like to compile them myself, its the only way i could learn and how to fix mistakes.

as for the solutions, its very easy, the script was looking for the static path named "DEVKITARM" however, some registers or cleaners, remove paths that they dont registers as officials, same thing occured with "DEVKITPRO".

Make install-zlib worked, but make sure the paths variables are set.
 

spoonm

Can count to 3.
Member
Joined
May 20, 2015
Messages
192
Trophies
0
Website
spoonm.org
XP
317
Country
Brazil
I don't think compiling your own binaries teaches you much significant. It's more of a "I can't really trust this man's/woman's files, so I'm compiling my own from the source code that I do trust" statement than anything.

Reading the source code, on the other hand, should help you learn more about - if not the language a project is written in - how the library works and whether you can trust it or not. If you want to become familiar with the compilation process, I suggest you try C compilers a bit or read their manuals. As Shadowtrance mentioned, you got two warnings, not errors. Had the compiler accused the source code of wrong syntax, it would've returned a non-zero value, telling whatever was running it(in this case, make, through a shell) that it ended in a failure. At that point, make would stop following the recipe for whatever file it was trying to create and tell you you got an error to deal with.

This thread belong in the computer programming subforum as it is unrelated to flashcards or custom firmwares. Despite being an issue with compiling portlibs, it is closest to standard computer programming than it is to homebrew or CFW.
 

Shadowtrance

Well-Known Member
Member
Joined
May 9, 2014
Messages
2,493
Trophies
0
Location
Hervey Bay, Queensland
XP
1,807
Country
I don't think compiling your own binaries teaches you much significant. It's more of a "I can't really trust this man's/woman's files, so I'm compiling my own from the source code that I do trust" statement than anything.

Reading the source code, on the other hand, should help you learn more about - if not the language a project is written in - how the library works and whether you can trust it or not. If you want to become familiar with the compilation process, I suggest you try C compilers a bit or read their manuals. As Shadowtrance mentioned, you got two warnings, not errors. Had the compiler accused the source code of wrong syntax, it would've returned a non-zero value, telling whatever was running it(in this case, make, through a shell) that it ended in a failure. At that point, make would stop following the recipe for whatever file it was trying to create and tell you you got an error to deal with.

This thread belong in the computer programming subforum as it is unrelated to flashcards or custom firmwares. Despite being an issue with compiling portlibs, it is closest to standard computer programming than it is to homebrew or CFW.
It's still helpful to figure out how to compile stuff on your own though so you learn stuff like this and make sure everything is setup nicely and correctly so it works smoothly.
I should know, i went through months of messing with shit on my own before i got everything working great and i learned a fair bit in the process. :)
But yes it is in the wrong section, the homebrew section would be more suitable (or the programming section as you mentioned i guess).
 

spoonm

Can count to 3.
Member
Joined
May 20, 2015
Messages
192
Trophies
0
Website
spoonm.org
XP
317
Country
Brazil
It's still helpful to figure out how to compile stuff on your own though so you learn stuff like this and make sure everything is setup nicely and correctly so it works smoothly.
I should know, i went through months of messing with shit on my own before i got everything working great and i learned a fair bit in the process. :)
But yes it is in the wrong section, the homebrew section would be more suitable (or the programming section as you mentioned i guess).

There is an advantage to knowing how to properly use a build tool and compiler. My point was that though it is good to know, it doesn't teach you a lot of significant things. Reading manuals here and there should get you sorted out to compile your own project, in up to two hours.

However, OP's approach to this seems off. Learning how to use a build tool "the hard way"(a.k.a. "look, mom! no instructions!") involves looking up error/warning messages yourself. After getting warning messages onscreen, he resorted to asking for help on this forum, which leads to the following possible conclusions:
  • Instead of trying to understand how the libraries were structured, programming-wise, to see if the warnings were about something that could impact their performance, or contacting the developer about the issue - either through Github or here -, or looking up those warnings to see if others had the same problem, he decided to ask for help.
  • His reasoning behind compiling his own binary files should be followed by "I don't know what I'm doing, but [I heard somewhere I should try this|the command line looks so cool|if I run into issues, I can just ask tempers for help!", since he doesn't seem to be looking things up to learn on his own, but rather expecting to be spoonfed.
  • OP is lazy and doesn't want to read the manual for make/a C compiler.
I don't mean to attack him personally, but this is not the way to go about learning how to compile 3DS projects.

As for the homebrew section being more suitable: homebrews and CFW alike could both use zlib on their projects. This thread's about the compilation process, so I think it would look more at home in the programming section.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    BakerMan @ BakerMan: https://garticphone.com/en/?c=0013ff1238