I'm currently trying to build buildroot with the postgresql package. I'm building on Debian Stretch x86_64. The target configuration in buildroot is for armel: BR2_ARCH="arm" BR2_ENDIAN="LITTLE" BR2_GCC_TARGET_ABI="aapcs-linux" BR2_GCC_TARGET_CPU="arm926ej-s" BR2_GCC_TARGET_FLOAT_ABI="soft" BR2_GCC_TARGET_MODE="arm" BR2_BINFMT_SUPPORTS_SHARED=y BR2_READELF_ARCH_NAME="ARM" BR2_BINFMT_ELF=y BR2_ARM_CPU_MAYBE_HAS_VFPV2=y BR2_ARM_CPU_HAS_ARM=y BR2_ARM_CPU_HAS_THUMB=y The configure script of postgresql throws an error for libxml2 (I build with --with-libxml as a custom option) and libz (this is standard, not changed by me): output/host/lib/libz.so: file not recognized: File format not recognized output/host/lib/libxml2.so: file not recognized: File format not recognized Seems as if the host libraries are wrong. If I replace these two libraries with the libs found in output/target/usr/lib, the build finishes without an error. I do not have this issue on Debian Stretch x86 (32bit). Greetings, Daniel
Created attachment 7606 [details] config.log of postgresql
Thanks for this report. Could you attach the build log of the postgresql package, from the extract step to the failure, and also the config.log file generated by postgresql's configure script ? Thanks!
Created attachment 7611 [details] build.log of buildroot postgresql
(In reply to Thomas Petazzoni from comment #2) The config.log is already attached (it's a zip file) and I attached the build.log now.
Could you please build without your custom --with-libxml option ? That's the reason for the failure. It ends up using xml2-config from your host machine, which returns bogus linker flags, which breaks the build. So it's basically your custom addition that breaks the build, the code in Buildroot builds fine. Please add: POSTGRESQL_CONF_ENV += XML2_CONFIG=$(STAGING_DIR)/usr/bin/xml2-config when enabling libxml2 support (i.e when you're passing --with-libxml). This should solve your problem. And please submit a Buildroot patch adding this, once everything works fine. Thanks!
Created attachment 7616 [details] Patch for the postgresql.mk to support libxml2 if selected This patch enables the configure option --with-libxml for PostgreSQL if libxml is enabled.
(In reply to Thomas Petazzoni from comment #5) Thanks for your reply! This solved the issue. I wouldn't have guessed something like this, but I'm not really familiar to buildroot backgrounds ;) I attached a patch with the changes of package/postgresql.mk and this patch adds --with-libxml just if libxml is enabled. I hope this is ok like this ... Greetings, Daniel
Thanks! Could you submit this patch on the Buildroot mailing list ? See https://buildroot.org/downloads/manual/manual.html#submitting-patches for details on how to do that.
(In reply to dde from comment #6) Thanks for the patch, looks good, the only missing thing is the dependency on libxml2, e.g.: POSTGRESQL_DEPENDENCIES += libxml2 Regards, Peter
(In reply to Peter Seiderer from comment #9) ..and for consistency with the other options (or buildroot style) the else branch: ifeq ($(BR2_PACKAGE_LIBXML2),y) POSTGRESQL_DEPENDENCIES += libxml2 POSTGRESQL_CONF_OPTS += --with-libxml POSTGRESQL_CONF_ENV += XML2_CONFIG=$(STAGING_DIR)/usr/bin/xml2-config else POSTGRESQL_CONF_OPTS += --without-libxml endif
(In reply to Peter Seiderer from comment #10) Thanks for your hints! I submitted the patch to the mailing list, at least I hope that it worked ;)
(In reply to dde from comment #11) Patch did not hit the mailing list (yet)...
(In reply to Peter Seiderer from comment #12) Yes, I figured out that the mail hasn't been sent although I thought so. I didn't manage to get the sendmail config running with our internal SMTP server so I sent the mail now manually through my private mail account. I hope the format is correct.