[Issue] Compiling libz.a issue

Discussion in '3DS - Flashcards & Custom Firmwares' started by ScarletDreamz, Feb 6, 2016.

  1. ScarletDreamz
    OP

    ScarletDreamz [Debug Mode]

    Member
    2,806
    1,206
    Feb 16, 2015
    United States
    California
    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:
    Warning: Spoilers inside!

    However, when y tri to compile libz.a in order to compile CTRBootManager [Wich i already compiled at my home], i get this error:
    Warning: Spoilers inside!

    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, Feb 6, 2016
  2. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,488
    1,517
    May 9, 2014
    Hervey Bay, Queensland
    Umm all i see is 2 warnings, that's it. What's the problem? :blink:
     
  3. ScarletDreamz
    OP

    ScarletDreamz [Debug Mode]

    Member
    2,806
    1,206
    Feb 16, 2015
    United States
    California
    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.
     
  4. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,488
    1,517
    May 9, 2014
    Hervey Bay, Queensland
    Umm did you use the "make install" command as it says on the portlibs page?
     
  5. ScarletDreamz
    OP

    ScarletDreamz [Debug Mode]

    Member
    2,806
    1,206
    Feb 16, 2015
    United States
    California
    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.
     
  6. ScarletDreamz
    OP

    ScarletDreamz [Debug Mode]

    Member
    2,806
    1,206
    Feb 16, 2015
    United States
    California
    ~#Fixed!
     
  7. clank

    clank Advanced Member

    Newcomer
    85
    24
    Jan 24, 2015
  8. ScarletDreamz
    OP

    ScarletDreamz [Debug Mode]

    Member
    2,806
    1,206
    Feb 16, 2015
    United States
    California
    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.
     
  9. spoonm

    spoonm Can count to 3.

    Member
    174
    84
    May 20, 2015
    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.
     
  10. Shadowtrance

    Shadowtrance GBAtemp Addict

    Member
    2,488
    1,517
    May 9, 2014
    Hervey Bay, Queensland
    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).
     
  11. spoonm

    spoonm Can count to 3.

    Member
    174
    84
    May 20, 2015
    Brazil
    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.
     
    RainThunder and Shadowtrance like this.