Nim support for powerpc64 has been added. Ref: https://github.com/nim-lang/Nim/pull/12011
Has this been tested and shown to work? I don't have a powerpc64 system so can't test it. If so, please submit a patch.
(In reply to Neal Nelson from comment #1) No patch is required. I’m able to build the port package after removing the “BROKEN_powerpc64” line in the makefile. However, I’ll ask someone else who has a PowerPC64 system to try building the package.
Still doesn't build on 12.1-RELEASE: ===> Building for nim-1.0.2 cd /usr/local/poudriere/ports/default/lang/nim/work/nim-1.0.2 && /usr/bin/env CC="cc" LINKER="cc" COMP_FLAGS=" -O2 -pipe -fstack-protector-strong -fno-strict-aliasing " LINK_FLAGS= " -fstack-protector-strong " /bin/sh build.sh # OS: freebsd # CPU: powerpc64 clang -w -O3 -fno-strict-aliasing -m64 -Ic_code -c c_code/1_2/stdlib_assertions.nim.c -o c_code/1_2/stdlib_assertions.nim.o build.sh: clang: not found It builds on when using clang in base but this is currently only on head and requires additional patches - official head still uses elfv1.
Created attachment 209232 [details] Patch to fix build on powerpc64 Thanks for the feedback! I completely forgot about testing on 12.x-RELEASE. The attached patch should fix builds on releases prior to 13-RELEASE.
Testing. Note that even head uses GCC for now.
Builds now on 12.1-RELEASE. I will commit your patch when the maintainer accepts it.
Comment on attachment 209232 [details] Patch to fix build on powerpc64 The patch looks OK to me.
Now it won't build on ELFv2: ===> Building for nim-1.0.2 cd /tmp/usr/ports/lang/nim/work/nim-1.0.2 && /usr/bin/env CC="cc" LINKER="cc" COMP_FLAGS=" -O2 -pipe -fstack-protector-strong -fno-strict-aliasing " LINK_FLAGS=" -fstack-protector-strong " /bin/sh build.sh # OS: freebsd # CPU: powerpc64 gcc -w -O3 -fno-strict-aliasing -m64 -Ic_code -c c_code/1_2/stdlib_assertions.nim.c -o c_code/1_2/stdlib_assertions.nim.o build.sh: gcc: not found You need to add those patches to EXTRA_PATCHES and make them apply only when GCC is used. See PPC_ABI variable.
Created attachment 209368 [details] Updated patch to fix build on powerpc64 Updated patch to check PPC_ABI.
Created attachment 209370 [details] Updated patch to fix build on powerpc64
There are still several issues. There is another include of bsd.port.pre.mk, which itself breaks build. It will be much cleaner to do it like: .if defined(PPC_ABI) && ${PPC_ABI} == ELFv2 EXTRA_PATCHES=${PATCHDIR}/elfv2-patch .else EXTRA_PATCHES=${PATCHDIR}/elfv1-patch .endif Such approach is clean and makes it easy to see what you do. In post-patch, you check for PPC_ABI, but this is only defined on powerpc64, which will break build on anything else. You could check like: .if defined(PPC_ABI) && ${PPC_ABI} == ELFv2 (or 1)
Created attachment 209410 [details] Revised patch Updated patch to reflect recommendations
Created attachment 209411 [details] Revised patch
(In reply to Curtis Hamilton from comment #13) It now builds on powerpc64 (both elfv1 and elfv2) and amd64. Once maintainer approves it, I'll post a review so that my mentors can approve it.
I've tried to set the maintainer flags to approved, but failing that here's my go ahead anyway.
A commit references this bug: Author: pkubaj Date: Wed Nov 27 19:55:14 UTC 2019 New revision: 518529 URL: https://svnweb.freebsd.org/changeset/ports/518529 Log: lang/nim: Remove BROKEN for powerpc64 Fix build on powerpc64 elfv1 and elfv2. PR: 241974 Submitted by: hamiltcl@verizon.net Approved by: ports@nicandneal.net (maintainer), tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D22568 Changes: head/lang/nim/Makefile head/lang/nim/files/elfv1-patch-build.sh