Skip to content

Commit

Permalink
net/norm: fix build on powerpc64 elfv2
Browse files Browse the repository at this point in the history
On ELFv2 ABI Clang can't build this port by default and throws assertion (already reported):
Assertion failed: ((Op.getOpcode() == ISD::FP_TO_SINT || Subtarget.hasFPCVT()) && "i64 FP_TO_UINT is supported only with FPCVT"), function LowerFP_TO_INTForReuse, file /poudriere/jails/powerpc64-elfv2-pkubaj/usr/src/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp, line 7281.
Stack dump:
0.	Program arguments: /usr/bin/c++ -cc1 -triple powerpc64-unknown-freebsd13.0 -emit-obj -disable-free -main-file-name protoDispatcher.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -relaxed-aliasing -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu ppc64 -target-feature +secure-plt -mfloat-abi hard -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -coverage-notes-file /wrkdirs/usr/ports/net/norm/work/norm-1.5r6/build/protolib/src/common/protoDispatcher.cpp.1.gcno -resource-dir /usr/lib/clang/9.0.1 -I /wrkdirs/usr/ports/net/norm/work/norm-1.5r6/build/protolib/include -I /wrkdirs/usr/ports/net/norm/work/norm-1.5r6/protolib/include -I /wrkdirs/usr/ports/net/norm/work/norm-1.5r6/build/protolib/include/unix -I /wrkdirs/usr/ports/net/norm/work/norm-1.5r6/protolib/include/unix -D UNIX -D HAVE_DIRFD -D HAVE_IPV6 -D HAVE_ASSERT -D HAVE_GETLOGIN -D HAVE_FLOCK -D NDEBUG -internal-isystem /usr/include/c++/v1 -O3 -fdeprecated-macro -fdebug-compilation-dir /wrkdirs/usr/ports/net/norm/work/norm-1.5r6/build -ferror-limit 19 -fmessage-length 0 -stack-protector 2 -fno-signed-char -fobjc-runtime=gnustep -fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-loops -vectorize-slp -faddrsig -o /wrkdirs/usr/ports/net/norm/work/norm-1.5r6/build/protolib/src/common/protoDispatcher.cpp.1.o -x c++ ../protolib/src/common/protoDispatcher.cpp
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module '../protolib/src/common/protoDispatcher.cpp'.
4.	Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@_ZN15ProtoDispatcher4WaitEv'
#0 0x000000001371df18 (/usr/bin/c+++0x1371df18)
#1 0x000000001371e594 (/usr/bin/c+++0x1371e594)
#2 0x000000001371b858 (/usr/bin/c+++0x1371b858)
#3 0x000000001371ed0c (/usr/bin/c+++0x1371ed0c)
#4 0x000000081520176c (/lib/libthr.so.3+0x1b76c)
c++: error: unable to execute command: Abort trap (core dumped)
c++: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 9.0.1 (git@github.com:llvm/llvm-project.git c1a0a213378a458fbea1a5c77b315c7dce08fd05) (based on LLVM 9.0.1)
Target: powerpc64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin
c++: note: diagnostic msg: PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script.
c++: note: diagnostic msg:

The workaround is to optimize for POWER7, which supports necessary features in hardware. This will break run-time for older CPU's, but at least we can get this port running on POWER7 and newer.

PR:		243227
Approved by:	hd@oc.dk (maintainer timeout)
  • Loading branch information
pkubaj committed Jan 23, 2020
1 parent 5d6824a commit a983c97
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion net/norm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@ USE_LDCONFIG= yes
PLIST_FILES= include/normApi.h lib/libnorm.so lib/libnorm.so.1 \
lib/libnorm.so.1.0.0

.include <bsd.port.pre.mk>

.if defined(PPC_ABI) && ${PPC_ABI} == ELFv2
CXXFLAGS+= -mcpu=power7
.endif

post-extract:
${CP} ${DISTDIR}/waf-2.0.19 ${WRKSRC}/waf

post-install:
${INSTALL_DATA} ${WRKSRC}/include/normApi.h ${STAGEDIR}${PREFIX}/include/
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libnorm.so.1.0.0

.include <bsd.port.mk>
.include <bsd.port.post.mk>

0 comments on commit a983c97

Please sign in to comment.