switchbrew / libnx

Library for Switch Homebrew

Home Page:https://switchbrew.github.io/libnx/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libnx 4.0.0 causing switch-curl build fails due to undefined references in library

eXhumer opened this issue · comments

The following error occurs while trying to build switch-curl v7.69.1 with libnx v4.0.0.
image

Looking into the config.log generated during curl build, it looks like problems with libnx.
image

Digging into libnx

https://github.com/switchbrew/libnx/blob/master/nx/source/runtime/switch_crt0.s#L86
_DYNAMIC used to be defined, but it was removed in commit e655b48. It seems to have been replaced by __nx_dynamic instead. This is most likely a bug.

https://github.com/switchbrew/libnx/blob/master/nx/source/kernel/thread.c#L19-L22
https://github.com/switchbrew/libnx/blob/master/nx/source/runtime/newlib.c#L32-L34
I found references to these variables in nx/switch.ld but have no clue on how they are being included in the sources linked above.

Well, switch-curl is depending on libnx, not otherwise, so switch-curl needs to be updated to apply libnx changes.

@masagrator Considering that the only SSL module related change (the module that switch-curl depends on due to addition of libnx ssl backend) happened from v3.3.0 to v4.0.0 was this, I find that hard to believe.

config.log

Full generated config.log from switch-curl configuration.

Does the provided binary package not work? What is it you're trying to do?

It works, but the provided binary only includes libnx ssl backend. This causes problem on devices that doesn't have the SSL Key in CAL0 as libnx ssl fails without a valid SSL Key. Many users now a day use Atmosphere's PRODINFO blanking or Incognito to wipe their CAL0 partition, which both removes the SSL Key. I was trying to replace --with-libnx with --with-mbedtls, but the same issue persists. After that, I noticed even the stock package from https://github.com/devkitPro/pacman-packages/tree/master/switch/curl also fails to build as well.

This causes problem on devices that doesn't have the SSL Key in CAL0 as libnx ssl fails without a valid SSL Key. ....That was already fixed.

I last tested libnx backend on 7.69.1-2 when it was not working, I see there was a new revision since then to fix the issue with this commit. Thank you for letting me know libnx ssl was fixed, I'm going to close this as I can just use that. But, this bug will still be a problem for future package builds for switch-curl.