Browse Source

mysql: remove $(FPIC), fix AARCH64 builds

mysql already makes sure that the compiler emits position-independent code when
appropriate, namely when compiling shared objects. The mysql build system puts
its own flag behind the CFLAGS, overriding whatever was set before.

Additionally, forcing applications into PIC mode will just slow them
down (mysql not only provides shared objects but also applications).

Last but not least OpenWrt's $(FPIC) can cause build failures. This is
the case currently for AARCH64:

  net_serv.o: In function `my_net_init':
  net_serv.cc:(.text+0x28): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against symbol `my_malloc' defined in .text section in ../mysys/libmysys.a(my_malloc.o)
  net_serv.cc:(.text+0x28): warning: Too many GOT entries for -fpic, please recompile with -fPIC
  /data/bowl-builder/aarch64_cortex-a53/build/sdk/staging_dir/toolchain-aarch64_cortex-a53_gcc-7.3.0_musl/bin/../lib/gcc/aarch64-openwrt-linux-musl/7.3.0/../../../../aarch64-openwrt-linux-musl/bin/ld: final link failed: Symbol needs debug section which does not exist
  collect2: error: ld returned 1 exit status
  Makefile:955: recipe for target 'mysqld' failed
  make[7]: *** [mysqld] Error 1

Remove $(FPIC) from TARGET_CFLAGS to address all of the above.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
lilik-openwrt-22.03
Sebastian Kemper 7 years ago
parent
commit
6a90253c80
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      utils/mysql/Makefile

+ 2
- 4
utils/mysql/Makefile View File

@ -1,5 +1,5 @@
# #
# Copyright (C) 2006-2015 OpenWrt.org
# Copyright (C) 2006-2018 OpenWrt.org
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/uclibc++.mk
PKG_NAME:=mysql PKG_NAME:=mysql
PKG_VERSION:=5.1.73 PKG_VERSION:=5.1.73
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=\ PKG_SOURCE_URL:=\
@ -61,8 +61,6 @@ ifneq ($(CONFIG_USE_UCLIBCXX),)
TARGET_CXX=g++-uc TARGET_CXX=g++-uc
endif endif
TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \ CONFIGURE_ARGS += \
--enable-shared \ --enable-shared \
--enable-static \ --enable-static \


Loading…
Cancel
Save