All the libraries here are installable through devkitPro pacman
devkitpro / pacman-packages Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://devkitpro.org
Home Page: https://devkitpro.org
All the libraries here are installable through devkitPro pacman
I've been trying to get cURL to work for a while now to use an API, but have no idea how to go about doing that.
I'm trying to use curl_easy
, which does seem to work on a Windows 11 install.
However when executed inside the 3DS, it just seems to return 6
or 7
status code.
And enabling verbose mode curl prints * timeout on name lookup is not supported
.
I even tried just downloading a simple file from github, but it just refuses to work.
I've tried looking at code from elsewhere as an example, but I can't seem to get it work.
Versions:
cURL/7.69.1-1
libctru/2.1.0-1
curl_easy_setopt(getTime, CURLOPT_URL, "time.nist.gov");
curl_easy_setopt(getTime, CURLOPT_PORT, 13L);
curl_easy_setopt(getTime, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(getTime, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(getTime, CURLOPT_STDERR, stdout);
curl_easy_setopt(getTime, CURLOPT_HTTP09_ALLOWED, 1L);
curl_easy_setopt(getTime, CURLOPT_WRITEFUNCTION, timeWriteCallback);
curl_easy_perform(getTime);
curl_easy_cleanup(getTime);
Heyo!
Not sure if this is the right repository to file this in(if it isn't, feel free to redirect me to the correct forum!)
I have recently set up devkitPro on Gentoo Linux, but while emerging I noticed the following for ``sys-apps/pacman`
For clarification, the notice refers to this bug report https://bugs.gentoo.org/711134
It seems there is no maintainer for pacman
at the moment, and the package is slated for removal in 9 days, and wanted to see how this would affect any users wishing to install the toolchains on Gentoo systems.
Hope you're having a nice day by the way, and I enjoy the software you have put out so far! 😁
Not really sure if it is worth porting, but since it's a fairly reputable graphics API, it may be useful to some people wanting to use OSG in games and what not.
DevilutionX will need libsndfile once diasurgical/devilutionX#1651 is merged
3ds and switch
The switch-curl package configuration fails due to missing file "sys/socket.h" which is included with libnx package.
Generated Log: config.log
I found a fix for it, but I don't know if it is the right fix. I had to add libnx include directory before configuring (CPPFLAGS="-I${DEVKITPRO}/libnx/include ${CPPFLAGS}"
before using ./configure
command). The reason I say why it may not be the right fix is because line 9 in switchvars.sh seems to already include them as "system" headers, making this addition un-necessary.
I installed devkitARM and msys2 on Windows through the devkitPro Updater. Attempting to run $DEVKITARM/bin/arm-none-eabi-gdb
in msys2 results in the error C:/devkitPro/devkitARM/bin/arm-none-eabi-gdb.exe: error while loading shared libraries: libstdc++-6.dll: cannot open shared object file: No such file or directory
.
The output of ldd $DEVKITARM/bin/arm-none-eabi-gdb
is
KERNEL32.DLL => /c/windows/System32/KERNEL32.DLL (0x7fffd87b0000)
KERNELBASE.dll => /c/windows/System32/KERNELBASE.dll (0x7fffd67f0000)
msvcrt.dll => /c/windows/System32/msvcrt.dll (0x7fffd8ac0000)
USER32.dll => /c/windows/System32/USER32.dll (0x7fffd7400000)
win32u.dll => /c/windows/System32/win32u.dll (0x7fffd5ff0000)
libwinpthread-1.dll => /opt/devkitpro/devkitARM/bin/libwinpthread-1.dll (0x64940000)
GDI32.dll => /c/windows/System32/GDI32.dll (0x7fffd8250000)
gdi32full.dll => /c/windows/System32/gdi32full.dll (0x7fffd6b50000)
msvcp_win.dll => /c/windows/System32/msvcp_win.dll (0x7fffd5ea0000)
ucrtbase.dll => /c/windows/System32/ucrtbase.dll (0x7fffd5d70000)
WS2_32.dll => /c/windows/System32/WS2_32.dll (0x7fffd7390000)
RPCRT4.dll => /c/windows/System32/RPCRT4.dll (0x7fffd8b60000)
libgcc_s_seh-1.dll => not found
libstdc++-6.dll => not found
a8e7d24 introduced switch-cmake which provides files to allow the usage of devkitA64 with cmake projects
but slightly different cmake files have already existed in the devkitpro-pkgbuild-helpers package (pkgbuild-scripts) with the devkitA64.cmake and switch.cmake files existing since at least 2018
What is the problem here?
Was pkgbuild-scripts forgotten about?
Were the cmake files copied into a new package to remove the need to install them for every toolchain?
Was it done for backwards compatibility? (even if so why not make pkgbuild-scripts depend on switch-cmake)
Maybe I'm missing a variable I'm supposed to be passing during compilation? This works great, but all the portlibs are installed to /opt/devkitpro/portlibs, and my devkitpro install is at ~/devkitPro. Thanks for any advice you may have.
Attempting to start arm-none-eabi-gdb (from devkitARM-gdb 9.2-4) in Windows results in no console output and the return code 127.
$ arm-none-eabi-gdb --help; echo $?
127
The copy of arm-none-eabi-gdb packaged with devkitARM-r53 works as expected (I don't have any newer devkitARM gdb versions to test in my pacman cache).
$ arm-none-eabi-gdb --help; echo $?
This is the GNU debugger. Usage:
gdb [options] [executable-file [core-file or process-id]]
gdb [options] --args executable-file [inferior-arguments ...]
...
0
Don't know if this is the proper place to report this, but some packages (at least switch-liblzma 5.2.4-1 and switch-liblzo2 2.10-1) fail to install with HTTP 404 so it looks like some files are misisng. I can install other packages from this repo just fine so this is probably a server-side error.
The offending commit (@WinterMute) : c971e9a
I'm using a relatively small chunksize, namely 256 in handheld mode and 512 in docked mode, to get the low latency required for a rhythm game (McOsu-NX).
The package 'devkit-env', which helpfully adds a few environment variables and appends the devkitPro-provided tool binaries to PATH, seems to be missing from the group wiiu-dev. The package is included in all the other groups listed on the devkitPro pacman wiki page such as switch-dev and nds-dev, which makes its exclusion from the wiiu-dev group seem like an oversight.
I install the package sdl2-switch but when I want use it in vscode, endian.h is not here. In the SDL_Endian.h you have to replace
#include <endian.h>
to
#include <machine.endian.h>
I've been getting "undefined" all the time trying to build with switch-mbedtls (installed from official repo as binary package)
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/10.2.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/portlibs/switch/lib/libmbedcrypto.a(entropy.c.obj): in function `mbedtls_hardware_poll':
entropy.c:(.text.mbedtls_hardware_poll+0x1c): undefined reference to `csrngGetRandomBytes'
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/10.2.0/../../../../aarch64-none-elf/bin/ld: read-only segment has dynamic relocations
collect2: error: ld returned 1 exit status
I've sourced switchvars.sh
before compiling it and tried all flags CFLAGS, CPPFLAGS, CXXFLAGS, in both -D __SWITCH__
and -D __SWITCH__=1
format, and I've tried it as ENV variables.. I'm starting to think the patch is never applied
Since switchvars.sh
is first sourced on https://github.com/devkitPro/pacman-packages/blob/master/switch/mbedtls/PKGBUILD#L32
It prevents it the variable from being initialized when building/distributing the package
and here is the conditional code
https://github.com/devkitPro/pacman-packages/blob/master/switch/mbedtls/switch-mbedtls.patch#L8
Which means, essentially the only way the .patch works is by building the PKG yourself and not via dkp-pacman?
When a cmake project changes the OUTPUT_NAME
property of a target or sets CMAKE_EXECUTABLE_SUFFIX
, the nx_generate_nacp
and nx_create_nro
functions don't work anymore.
Example the following project:
CMakeLists.txt
cmake_minimum_required(VERSION 3.8)
project(alt_name)
add_executable(exe exe.c)
# Either one of the following makes this project fail to build
set_property(TARGET exe PROPERTY OUTPUT_NAME "awesome_exe")
set(CMAKE_EXECUTABLE_SUFFIX ".elf")
nx_generate_nacp(awesome.nacp NAME exe)
nx_create_nro(exe NACP awesome.nacp)
exe.c
int main() {
return 0;
}
Using the devkitpro/devkita64
docker image, building the project fails with the following error:
[ 75%] Generating awesome.nacp
/opt/devkitpro/tools/bin/nacptool --create exe "Unspecified Author" 1.0.0 awesome.nacp
[100%] Generating exe.nro
/opt/devkitpro/tools/bin/elf2nro exe exe.nro --icon=/opt/devkitpro/libnx/default_icon.jpg --nacp=awesome.nacp
Failed to open input!
The error occurs because the cmake toolchain assumes the output filename is the same as the target name.
I can fix this by applying the following patch:
--- /opt/devkitpro/cmake/Switch.cmake 2021-06-14 10:23:20.000000000 +0000
+++ ../Switch.cmake 2021-06-22 16:11:14.049765329 +0000
@@ -81,16 +81,19 @@
add_custom_command(
OUTPUT "${outfile}"
- COMMAND "${NX_NACPTOOL_EXE}" --create "${NACP_NAME}" "${NACP_AUTHOR}" "${NACP_VERSION}" "${outfile}"
+ COMMAND "${NX_NACPTOOL_EXE}" --create "$<TARGET_FILE:${NACP_NAME}>" "${NACP_AUTHOR}" "${NACP_VERSION}" "${outfile}"
+ DEPENDS ${NACP_NAME}
VERBATIM
)
endfunction()
-function(nx_create_nro prefix)
+function(nx_create_nro target)
cmake_parse_arguments(ELF2NRO "NOICON;NONACP" "ICON;NACP;ROMFS" "" ${ARGN})
- set(ELF2NRO_ARGS ${prefix} "${prefix}.nro")
- set(ELF2NRO_DEPS ${prefix})
+ get_target_property(TARGET_OUTPUT_NAME ${target} OUTPUT_NAME)
+
+ set(ELF2NRO_ARGS "$<TARGET_FILE:${target}>" "${TARGET_OUTPUT_NAME}.nro")
+ set(ELF2NRO_DEPS ${target})
if (DEFINED ELF2NRO_ICON AND ELF2NRO_NOICON)
message(FATAL_ERROR "nx_create_nro: cannot specify ICON and NOICON at the same time")
@@ -105,7 +108,7 @@
endif()
if (NOT DEFINED ELF2NRO_NACP AND NOT ELF2NRO_NONACP)
- set(ELF2NRO_NACP "${prefix}.default.nacp")
+ set(ELF2NRO_NACP "${target}.default.nacp")
nx_generate_nacp(${ELF2NRO_NACP})
endif()
@@ -139,15 +142,15 @@
endif()
add_custom_command(
- OUTPUT "${prefix}.nro"
+ OUTPUT "${TARGET_OUTPUT_NAME}.nro"
COMMAND "${NX_ELF2NRO_EXE}" ${ELF2NRO_ARGS}
DEPENDS ${ELF2NRO_DEPS}
VERBATIM
)
add_custom_target(
- "${prefix}_nro" ALL
- DEPENDS "${prefix}.nro"
+ "${target}_nro" ALL
+ DEPENDS "${TARGET_OUTPUT_NAME}.nro"
)
endfunction()
When building the project above, awesome_exe.elf
, awesome_exe.nro
and awesome.nacp
are generated.
seems like #104 pkgbuild ships with wrongly linked thing, therefore it ships broken packages.
😢
The things, (That I am not quite sure+ speculation), is ./configure is not being good to detect on it.
curl just gives me error 6 (Couldn't resolve hostname) whenever I try to download something to a file.
Doesn't anyone not want to build games for those consoles? No demand hence no package?
I have devkitpro instaled but i keep getting this
[fennectech@Aluminum ~/scummvm]$ ./configure --host=switch --backend=switch
Running ScummVM configure...
Looking for C++ compiler... none found!
I saw the add for Switch and was going to an adaptation of it for nds-portlibs.
I'll try it out with dslibris. This will help out Arabic-speaking users.
Hi,
I am trying to switch the scaling filter to GL_NEAREST using these methods but none of them works.
1. SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest"); // not workable, still linear filter
2. SDL_SetTextureScaleMode(texture, SDL_ScaleModeNearest); // crash
GL_NEAREST filter is very useful for pixel games, I am wondering if it is possible to support this filter in switch-sdl2. (I guess this is already supported by mesa.)
hi, when trying to build https://github.com/saucesaft/xash3d-wii it fails with
Checking for 'freetype2' : yes
Checking for 'freetype2' sanity : no
freetype2 isn't installed correctly. Make sure you installed proper development package for target architecture
even though i have installed ppc-freetype
(github says build fails but thats because they don't tell it to install devkit pro devkitPPC at all) note: devkitPro is an organisation that provides toolchains and libraries, we are not something you install
Not to sure if this is the right repo to ask but I see most of the cmake related definitions so I'm going to guess it is.
I have been trying to use the wii's <di/di.h> library for a while now along with cmake. I know that in a makefile the you simply need to add -ldi to LIBS and that's all you need. However, I have no idea how that works in cmake. Could I get some help?
For reference, here is my CMakeLists.txt
cmake_minimum_required(VERSION 3.12)
project ("tester" LANGUAGES CXX C VERSION 0.0.1)
file(GLOB helloworld_SRC
"*/*.h"
"*/*.c"
"*/*.hpp"
"*/*.cpp"
)
add_executable (${PROJECT_NAME} ${helloworld_SRC})
ogc_create_dol(${PROJECT_NAME})
Also yes I know that using glob is heavily discouraged but it makes it easier for templates when I'm experimenting with projects like this.
I've looked at the boost libraries, and they look like a nightmare to compile. I have no idea if it's possible to compile for the switch or not.
While working on OpenBOR for the 3DS, i ran into the issue that SDL 1.2 for 3DS didn't have support for the AUDIO_S16SYS format.
The audio formats are explained here:
https://www.libsdl.org/release/SDL-1.2.15/docs/html/sdlaudiospec.html
To my understanding, both AUDIO_S16 and AUDIO_S16SYS will always point to AUDIO_S16LSB.
However, AUDIO_S16 is added as a supported format while AUDIO_S16SYS and AUDIO_S16LSB are not.
Can anyone more familiar with the matter give some insight if the format can be added as supported?
Or are there more related issues involved?
Would this cause any issues?
https://github.com/MrHuu/pacman-packages/commit/63f55a34a21e9ac803f2ced2e1879d2ef42c7696
Hey there! Any plans to merge SDL1.2 soon? I could help with testing I guess if that's what we are gated on.
Thanks for your work, awesome as usual!
Hi there,
I updated devkitPPC from r32 to r35 using Pacman, after that when I tried to build Snes9x Gx (Wii build), then I get: ft2build.h no such file or directory
I installed all packages I used before:
ppc-bzip2 ppc-freetype ppc-libjpeg-turbo ppc-libogg ppc-libpng ppc-libvorbisidec ppc-mpg123 ppc-mxml ppc-pkg-config ppc-zlib
Any idea what could cause this?
Thanks in advance.
The current version of 3ds-curl will always exit with "select/poll error" when trying to download ftp urls. This can be fixed by removing "#define HAVE_POLL_FINE 1" in file lib/curl_config.h, line 540 after executing ./configure and before executing make.
Seems like the poll() implementation is buggy on the 3DS and curl should rather rely on select().
I updated my devkitPro bundle a few hours ago using pacman, built my project (with no compiler errors after switching to new devkitPro version) and It won't register any X / Y button presses anymore. It still registers bumpers and B / A keys.
Before this I used devkitPro from ~February fetched from SourceForge (sorry but I don't know specific version number ).
File where I scan for input:
https://github.com/dbeef/spelunky-ds/blob/master/source/input/input_handler.cpp
It's same on both desmume and my NDS with moonshell.
Ever since SDL2_Image was updated in the pacman packages I have been unable to get my switch game which uses that library to build. I've had to build from my other PC which still has the old version of SDL2_Image
I get a linker error when trying to build with the new SDL2_image:
/opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/portlibs/switch/lib/libSDL2_image.a(IMG_webp.o): in function IMG_InitWEBP': IMG_webp.c:(.text.IMG_InitWEBP+0x10): undefined reference to
WebPGetFeaturesInternal'
/opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/../../../../aarch64-none-elf/bin/ld: IMG_webp.c:(.text.IMG_InitWEBP+0x14): undefined reference to WebPDecodeRGBInto' /opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/../../../../aarch64-none-elf/bin/ld: IMG_webp.c:(.text.IMG_InitWEBP+0x18): undefined reference to
WebPDecodeRGBAInto'
/opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/../../../../aarch64-none-elf/bin/ld: IMG_webp.c:(.text.IMG_InitWEBP+0x1c): undefined reference to WebPGetFeaturesInternal' /opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/../../../../aarch64-none-elf/bin/ld: IMG_webp.c:(.text.IMG_InitWEBP+0x20): undefined reference to
WebPDecodeRGBInto'
/opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/../../../../aarch64-none-elf/bin/ld: IMG_webp.c:(.text.IMG_InitWEBP+0x24): undefined reference to `WebPDecodeRGBAInto'
collect2: error: ld returned 1 exit status
Not sure if this is the right place to report this, but installing the switch-dev metapackage does not add /opt/devkitpro/devkitA64/bin to the path in /etc/profile.d/devkit-env.sh
Hi!
I was wondering if it's possible to have ffmpeg compiled against mbedtls for tls support and so that we can use https protocol for ffmpeg and mpv.
If there's anything that I can do to help out on my end, let me know. Thanks!
I seem to be unable to get devkitARM r55 on macOS 10.13.
sudo dkp-pacman -Syu
tells me that dkp-osx is up to date, and sudo dkp-pacman -Sl
shows me that I have devkitARM r54-3
installed. Is r55 not available for dkp-osx?
When I try to compile cmake packages it fails.
I will be using the 3ds as an example however it is not limited to it.
I get an error
CMake Error at /usr/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"/opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/oreo639/git/pacman-packages/3ds/TinyXML2/src/tinyxml2-6.0.0/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_3ff76/fast"
/usr/bin/make -f CMakeFiles/cmTC_3ff76.dir/build.make CMakeFiles/cmTC_3ff76.dir/build
make[1]: Entering directory '/home/oreo639/git/pacman-packages/3ds/TinyXML2/src/tinyxml2-6.0.0/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_3ff76.dir/testCCompiler.c.o
/opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O2 -mword-relocations -ffunction-sections -fdata-sections -D_3DS -I /opt/devkitpro/portlibs/3ds/include -I /opt/devkitpro/libctru/include -o CMakeFiles/cmTC_3ff76.dir/testCCompiler.c.o -c /home/oreo639/git/pacman-packages/3ds/TinyXML2/src/tinyxml2-6.0.0/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_3ff76
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3ff76.dir/link.txt --verbose=1
/opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -O2 -mword-relocations -ffunction-sections -fdata-sections -D_3DS -I /opt/devkitpro/portlibs/3ds/include -I /opt/devkitpro/libctru/include -L/opt/devkitpro/portlibs/3ds/lib -L/opt/devkitpro/libctru/lib -rdynamic CMakeFiles/cmTC_3ff76.dir/testCCompiler.c.o -o cmTC_3ff76
arm-none-eabi-gcc: error: unrecognized command line option '-rdynamic'
make[1]: *** [CMakeFiles/cmTC_3ff76.dir/build.make:87: cmTC_3ff76] Error 1
make[1]: Leaving directory '/home/oreo639/git/pacman-packages/3ds/TinyXML2/src/tinyxml2-6.0.0/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_3ff76/fast] Error 2
This can be fixed by removing
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -specs=3dsx.specs")
fromand changing include(devkitarm.cmake) to include(/opt/devkitpro/devkitarm.cmake)
in 3ds.cmake. Is this intentional or am I doing something wrong?
(ofc you also have to change devkitarm.cmake, in the PKGBUILD, to 3ds.cmake but that is a different issue)
when I try to access https ardress - get error 35 (SSL connection error)
example:
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); curl_easy_setopt(curl, CURLOPT_URL, "https://github.com");
Im getting a function redefinition error with SDL_LoadFunction and SDL_UnloadObject.
/opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/8.2.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/portlibs/switch/lib/libSDL2.a(SDL_sysloadso.o): in function `SDL_LoadFunction': /home/davem/projects/devkitpro/pacman-packages/switch/SDL2/src/SDL2-2.0.8/src/loadso/dummy/SDL_sysloadso.c:42: multiple definition of `SDL_LoadFunction'; /opt/devkitpro/portlibs/switch/lib/libSDL2.a(SDL_switchopengles.o):/home/davem/projects/devkitpro/pacman-packages/switch/SDL2/src/SDL2-2.0.8/src/video/switch/SDL_switchopengles.c:65: first defined here /opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/8.2.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/portlibs/switch/lib/libSDL2.a(SDL_sysloadso.o): in function `SDL_UnloadObject': /home/davem/projects/devkitpro/pacman-packages/switch/SDL2/src/SDL2-2.0.8/src/loadso/dummy/SDL_sysloadso.c:50: multiple definition of `SDL_UnloadObject'; /opt/devkitpro/portlibs/switch/lib/libSDL2.a(SDL_switchopengles.o):/home/davem/projects/devkitpro/pacman-packages/switch/SDL2/src/SDL2-2.0.8/src/video/switch/SDL_switchopengles.c:71: first defined here
I have an error build since update sdl2 2.0.8-10 with pacman
c:/devkitpro/devkita64/bin/../lib/gcc/aarch64-none-elf/8.2.0/../../../../aarch64-none-elf/bin/ld.exe: C:/devkitPro/portlibs/switch/lib\libSDL2.a(SDL_egl.o): in function `SDL_EGL_LoadLibrary':
/home/davem/projects/devkitpro/pacman-packages/switch/SDL2/src/SDL2-2.0.8/src/video/SDL_egl.c:377: undefined reference to `eglGetDisplay'
SDL 1.2 only supports single-screen operation and is not convenient. And SDL 1.2 is also old.
Package details:
wii-sdl_ttf
2.0.11-2
wii-sdl_gfx
2.0.25-2
Both of them are actually the 3DS version:
carsten@sol ~> ar p /opt/devkitpro/portlibs/wii/lib/libSDL_ttf.a | file -
/dev/stdin: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), not stripped
I guess this was happening because of an unclean build directory.
The following cmake project fails to build when using the switch cmake toolchain:
CMakeLists.txt
cmake_minimum_required(VERSION 3.8)
project(main_from_lib)
add_library(staticlib static.c)
add_executable(executable exe.c)
target_link_libraries(executable PRIVATE staticlib)
static.c
int some_func(void);
int main() {
return some_func();
}
exe.c
int some_func(void) {
return 0;
}
Building with switch-cmake with the current devkitpro/devkita64
docker images gives the following output (and error):
/opt/devkitpro/portlibs/switch/bin/aarch64-none-elf-cmake -S ../nxsamp/ -B. && make
-- The C compiler identification is GNU 11.1.0
-- The CXX compiler identification is GNU 11.1.0
-- Check for working C compiler: /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc
-- Check for working C compiler: /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++
-- Check for working CXX compiler: /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /conan/ff
Scanning dependencies of target staticlib
[ 25%] Building C object CMakeFiles/staticlib.dir/static.c.obj
[ 50%] Linking C static library libstaticlib.a
[ 50%] Built target staticlib
Scanning dependencies of target executable
[ 75%] Building C object CMakeFiles/executable.dir/exe.c.obj
[100%] Linking C executable executable
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/11.1.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/libnx/lib/libnx.a(switch_crt0.o): in function `_start':
/home/fincs/pacman-packages/libnx/src/libnx-4.1.1/nx/source/runtime/switch_crt0.s:70: undefined reference to `main'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/executable.dir/build.make:85: executable] Error 1
make[1]: *** [CMakeFiles/Makefile2:110: CMakeFiles/executable.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
This can be fixed by adding -lnx
twice to the linker flags: once before the user object and libraries and once at the end.
Applying the following patch to ${DEVKITPRO}/cmake/Switch.cmake
fixed the error for me:
--- /opt/devkitpro/cmake/Switch.cmake 2021-06-14 10:23:20.000000000 +0000
+++ ../Switch.cmake 2021-06-22 15:13:09.613154005 +0000
@@ -12,7 +12,7 @@
set(CMAKE_CXX_FLAGS_INIT "${NX_COMMON_FLAGS}")
set(CMAKE_ASM_FLAGS_INIT "${NX_COMMON_FLAGS}")
-set(CMAKE_EXE_LINKER_FLAGS_INIT "${NX_ARCH_SETTINGS} ${NX_LIB_DIRS} -fPIE -specs=${DEVKITPRO}/libnx/switch.specs")
+set(CMAKE_EXE_LINKER_FLAGS_INIT "${NX_ARCH_SETTINGS} ${NX_LIB_DIRS} -fPIE -specs=${DEVKITPRO}/libnx/switch.specs -lnx")
set(CMAKE_FIND_ROOT_PATH
${CMAKE_FIND_ROOT_PATH}
BASH_SOURCE variable is specific to bash.
${DEVKITPRO} can be used instead, as the script switchvars is located at the root folder of devkitpro.
Or, a trick like this one https://gist.github.com/elentok/5546958 can be used.
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
#---------------------------------------------------------------------------------
I see that libcurl is compiled both without ssl and http2 support, letting http2 aside. When I compiled openssl.
When I set up the flag of ssl in curl configure it fails(i will provide more details).
Also why the switch didn't get a mbedtls port like 3ds?
Regards
It appears that Devkit-pro the switch SDL2 package is also affected by the broken CMake rule in SDL 2.0.12 since it was updated:
https://bugzilla.libsdl.org/show_bug.cgi?id=5039
A patch was already made that has been verified to fix this issue for macOS: https://hg.libsdl.org/SDL/rev/60f1e9fb5957
This is currently preventing DevilutionX from building for Switch: diasurgical/devilutionX#719
Simple sdl2 code without open gl request doesn't works on hardware and software since patch 2.0.8-10...
Sometimes works 1 time out of 10...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.