1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00

databases/mysql80-server: fix build of client on powerpc

On powerpc, clang miscompiles comp_err, which later fails at runtime with:
->  0x102ff48c <+16>: .long  0x0006ee74                ; unknown opcode
The problem happens because of line:
frame #0: 0x10323eb4 comp_err`set_my_errno(my_errno=-10608) at my_thr_init.cc:344:47

GCC can compile client, but without -malign-double. It also needs to link to
libatomic (so building without GCC installed wouldn't work anyway).

This only fixes client. Server still fails to build because of:
/wrkdirs/usr/ports/databases/mysql80-server/work/mysql-8.0.32/storage/innobase/include/log0sys.h:190:60: error: static assertion failed
  190 |   static_assert(decltype(write_to_file_requests_interval)::is_always_lock_free);
This commit is contained in:
Piotr Kubaj 2023-03-02 18:43:16 +00:00
parent 518e34bd77
commit ba9f8de67e

View File

@ -15,8 +15,8 @@ LICENSE= GPLv2
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}${DISTVERSIONSUFFIX}
SLAVEDIRS= databases/mysql80-client
USES= bison:build cmake:noninja compiler:c++17-lang cpe \
groff:run libedit localbase ncurses perl5 pkgconfig shebangfix ssl
USES= bison:build cmake:noninja cpe groff:run libedit localbase \
ncurses perl5 pkgconfig shebangfix ssl
CPE_VENDOR= oracle
@ -53,7 +53,7 @@ BUILD_DEPENDS_powerpc64= libunwind>0:devel/libunwind
BUILD_DEPENDS_powerpc64le= libunwind>0:devel/libunwind
CMAKE_BUILD_TYPE= Release
CFLAGS+= -fPIC -malign-double
CFLAGS+= -fPIC
CFLAGS_aarch64?= -march=armv8-a+crc+crypto
CMAKE_ARGS+= -DINSTALL_LAYOUT=FREEBSD \
@ -184,6 +184,14 @@ FEDERATED_SUB_LIST_OFF+= FEDER=""
SSP_UNSAFE= yes
.endif
.if ${ARCH} == powerpc
LDFLAGS+= -latomic
USES+= compiler:gcc-c++11-lib
.else
CXXFLAGS+= -malign-double
USES+= compiler:c++17-lang
.endif
post-extract:
@${RM} -rv ${WRKSRC}/sql/sql_hints.yy.cc ${WRKSRC}/sql/sql_hints.yy.h