Hello ports list,

We don't build devel/clang-tools-extra for macppc because,

BROKEN-powerpc =        no consumers on powerpc, save 25 build hours in bulks

This reason (from cwen@ in Jul 2020) is still true; the consumers
devel/kdevelop and devel/qt-creator don't exist on powerpc, because
they depend on x11/qt5/qtwebengine, which is only for amd64 aarch64.

If you remove the BROKEN line, then the powerpc build wastes some
hours, then fails to link clang-tidy with "relocation truncated to
fit" errors.  I got the below diff from Brad Smith.  It adds
-Wl,--relax to fix the errors.  With this diff, a 2700 MHz G5 built
clang-tools-extra in just under 19 hours (18:43:47).

Do we commit this diff?

I would drop this diff and leave the port as is.  The BROKEN reason
is still true.  If we add -Wl,--relax, we would delete -Wl,--relax
when macppc switches from ld.bfd to ld.lld.

Because I took 19 hours to build it, I feel that I should at least
share the diff.  I tried a few tools on macppc with a single C file in
a CMake project (because cmake generates the compile_commands.json for
these tools).  clang-tidy warned of a magic number in my C, and
clang-reorder-fields reordered my struct, but then clang-rename missed
a spot when it renamed my struct.    --George

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/clang-tools-extra/Makefile,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile
--- Makefile    7 Sep 2020 08:54:29 -0000       1.11
+++ Makefile    24 Jan 2021 18:33:00 -0000
@@ -9,7 +9,6 @@
 # patches: rm patches/patch-*lld*
 
 ONLY_FOR_ARCHS =       ${LLVM_ARCHS}
-BROKEN-powerpc =       no consumers on powerpc, save 25 build hours in bulks
 
 COMMENT=       Clang extra tools
 
@@ -66,6 +65,11 @@ CONFIGURE_ARGS +=    -DCLANG_ENABLE_STATIC_
                        -DLLVM_INCLUDE_EXAMPLES=OFF \
                        -DLLVM_INCLUDE_TESTS=OFF \
                        -DLLVM_INCLUDE_BENCHMARKS=OFF
+
+.if ${MACHINE_ARCH} == "powerpc"
+CONFIGURE_ARGS +=      -DCMAKE_EXE_LINKER_FLAGS="-Wl,--relax"
+CONFIGURE_ARGS +=      -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--relax"
+.endif
 
 GCC_VER =              8.4.0
 .if ${MACHINE_ARCH} == "amd64"

Reply via email to