Espresso (Nintendo Wii U) SMP build support

2025-02-24 Thread Kurt Stine
Hello all,

What would it take to have a debian build for the Espresso (Nintendo Wii U) CPU?

Currently, due to overall Espresso weirdness, both GCC and glibc need to be 
patched for any applications to take advantage of all three cores. This means 
every application and library needs to be patched to be able to support smp on 
the Wii U. Debian powerpc will currently run on the Wii U, but due to the lack 
of patches, you are stuck with only a single core, and performance is extremely 
hampered by that. Adelie Linux currently has support for the Wii U, but it 
would be great to have a debian build.

The Wii U has three cores and 2GB of RAM, so it's relatively powerful machine 
for the price (you can find them for around $25 online). I'm also able to 
provide access to multiple if needed.

The smp patches are available here: https://gitlab.com/linux-wiiu/smp-patches

Currently, there is not a patch for LLVM, so any applications that are built 
with clang will not run on an smp-patched build.

Any input is appreciated!

Regards,
Kurt


Bug#1098791: kicad: Please include patch to link against libatomic on powerpc

2025-02-24 Thread John Paul Adrian Glaubitz
Source: kicad
Version: 9.0.0+dfsg-1
Severity: normal
Tags: patch
User: debian-powerpc@lists.debian.org
Usertags: powerpc
X-Debbugs-Cc: debian-powerpc@lists.debian.org

Hi,

src:kicad currently fails to build from source due to missing linking against 
libatomic:

[ 34%] Linking CXX executable bitmap2component
cd /build/reproducible-path/kicad-9.0.0+dfsg/debian/build/bitmap2component && 
/usr/bin/cmake -E cmake_link_script CMakeFiles/bitmap2component.dir/link.txt 
--verbose=1
/usr/bin/ld: ../common/libcommon.a(wx_view_controls.cpp.o): undefined reference 
to symbol '__atomic_fetch_add_8@@LIBATOMIC_1.0'
/usr/bin/ld: /lib/powerpc-linux-gnu/libatomic.so.1: error adding symbols: DSO 
missing from command line
collect2: error: ld returned 1 exit status

This can be fixed by patching debian/rules to append -latomic to 
DEB_LDFLAGS_MAINT_APPEND:

--- debian/rules.orig   2025-02-23 07:00:36.0 -0800
+++ debian/rules2025-02-23 22:43:58.488539668 -0800
@@ -9,6 +9,11 @@
 CFLAGS+=$(CPPFLAGS)
 CXXFLAGS+=$(CPPFLAGS)
 
+# workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358
+ifneq (,$(filter $(DEB_HOST_ARCH), armel m68k powerpc sh4))
+export DEB_LDFLAGS_MAINT_APPEND += -Wl,--no-as-needed -latomic -Wl,--as-needed
+endif
+
 # out of tree build folder for kicad application
 DEB_BUILD_DIR=debian/build
 # default install folder

Please see the attached patch. I have also included armel, m68k and sh4 in the
architecture list as this should also be necessary on these architectures.

PS: Would be nice if kicad could be built for any architecture.

Thanks,
Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
--- debian/rules.orig   2025-02-23 07:00:36.0 -0800
+++ debian/rules2025-02-23 22:43:58.488539668 -0800
@@ -9,6 +9,11 @@
 CFLAGS+=$(CPPFLAGS)
 CXXFLAGS+=$(CPPFLAGS)
 
+# workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358
+ifneq (,$(filter $(DEB_HOST_ARCH), armel m68k powerpc sh4))
+export DEB_LDFLAGS_MAINT_APPEND += -Wl,--no-as-needed -latomic -Wl,--as-needed
+endif
+
 # out of tree build folder for kicad application
 DEB_BUILD_DIR=debian/build
 # default install folder


Re: Bug#1098791: kicad: Please include patch to link against libatomic on powerpc

2025-02-24 Thread Simon Richter

Hi,

On 2/24/25 18:02, John Paul Adrian Glaubitz wrote:


+export DEB_LDFLAGS_MAINT_APPEND += -Wl,--no-as-needed -latomic -Wl,--as-needed


That smells wrong, there should be no need for --no-as-needed, and 
without that, this can just be linked unconditionally everywhere.


It should be fixed upstream though, by making libatomic a PUBLIC 
dependency of libcommon.



Please see the attached patch. I have also included armel, m68k and sh4 in the
architecture list as this should also be necessary on these architectures.


Probably also riscv.


PS: Would be nice if kicad could be built for any architecture.


The main problem would probably be below "thirdparty/libcontext", which 
has some assembler code.


   Simon


OpenPGP_0xEBF67A846AABE354.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: Bug#1098791: kicad: Please include patch to link against libatomic on powerpc

2025-02-24 Thread John Paul Adrian Glaubitz
On Mon, 2025-02-24 at 19:37 +0900, Simon Richter wrote:
> Hi,
> 
> On 2/24/25 18:02, John Paul Adrian Glaubitz wrote:
> 
> > +export DEB_LDFLAGS_MAINT_APPEND += -Wl,--no-as-needed -latomic 
> > -Wl,--as-needed
> 
> That smells wrong, there should be no need for --no-as-needed, and 
> without that, this can just be linked unconditionally everywhere.

It's commonly used across Debian like that. But feel free to adjust the
flags to suit your own preferences. I'm just suggesting a patch that is
known to work and that I have verified on powerpc (perotto.debian.net).

> It should be fixed upstream though, by making libatomic a PUBLIC 
> dependency of libcommon.

I fully agree.

> > Please see the attached patch. I have also included armel, m68k and sh4 in 
> > the
> > architecture list as this should also be necessary on these architectures.
> 
> Probably also riscv.
> 
> > PS: Would be nice if kicad could be built for any architecture.
> 
> The main problem would probably be below "thirdparty/libcontext", which 
> has some assembler code.

Okay, fair enough. I will look into adding sparc64 in the future then as it's
actually supported even by Kicad's libcontext fork [1].

Adrian

> [1] https://github.com/twlostow/libcontext

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913