Browse Source

postgresql: clean up CFLAGS

- The extra include is removed; the postgresql build system adds this
  include by itself.

- '-lpthread' is removed; the postgresql build system is able to detect
  how to access pthread features by itself.

- '$(FPIC)' is removed; adding this to CFLAGS is not recommendable:

  a) The postgresql build system adds its own PIC flag behind OpenWrt's
  CFLAGS when compiling shared objects, overriding OpenWrt's setting.
  b) Forcing applications into PIC mode will just slow them down.
  c) This leads to build failures on aarch64:

    access/transam/commit_ts.o: In function `CommitTsPagePrecedes':
    commit_ts.c:(.text+0x14): relocation truncated to fit: R_AARCH64_LD64_GOTPAGE_LO15 against symbol `TransactionIdPrecedes' defined in .text section in access/transam/transam.o
    commit_ts.c:(.text+0x14): warning: Too many GOT entries for -fpic, please recompile with -fPIC
    /var/lib/buildbot/slaves/dave-builder/aarch64_generic/build/sdk/staging_dir/toolchain-aarch64_generic_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

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
lilik-openwrt-22.03
Sebastian Kemper 7 years ago
parent
commit
8e9ad7bb51
1 changed files with 0 additions and 4 deletions
  1. +0
    -4
      libs/postgresql/Makefile

+ 0
- 4
libs/postgresql/Makefile View File

@ -155,8 +155,6 @@ CONFIGURE_ARGS += \
--enable-depend \ --enable-depend \
$(if $(CONFIG_TARGET_avr32),--disable-spinlocks) $(if $(CONFIG_TARGET_avr32),--disable-spinlocks)
EXTRA_CFLAGS:= -I$(PKG_BUILD_DIR)/src/include/
# Need a native ecpg, pg_config and zic for build # Need a native ecpg, pg_config and zic for build
define Host/Compile define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR)/src/bin/pg_config CC="$(HOSTCC)" $(MAKE) -C $(HOST_BUILD_DIR)/src/bin/pg_config CC="$(HOSTCC)"
@ -179,8 +177,6 @@ define Build/Configure
$(SED) 's@ECPG = ../../preproc/ecpg@ECPG = $(STAGING_DIR_HOSTPKG)/bin/ecpg@' $(PKG_BUILD_DIR)/src/interfaces/ecpg/test/Makefile.regress $(SED) 's@ECPG = ../../preproc/ecpg@ECPG = $(STAGING_DIR_HOSTPKG)/bin/ecpg@' $(PKG_BUILD_DIR)/src/interfaces/ecpg/test/Makefile.regress
endef endef
TARGET_CFLAGS += $(FPIC) -lpthread
# because PROFILE means something else in the project Makefile # because PROFILE means something else in the project Makefile
unexport PROFILE unexport PROFILE


Loading…
Cancel
Save