ostreedev / ostree

Operating system and container binary deployment and upgrades
https://ostreedev.github.io/ostree/
Other
1.31k stars 300 forks source link

ostree relocation R_X86_64_TPOFF32 against `frame_nr' can not be used when making a shared object; recompile with -fPIC #2148

Open Phoenix-Starlight opened 4 years ago

Phoenix-Starlight commented 4 years ago

Hi, I am trying to build ostree on Bionic Puppy Linux (based on Ubuntu Bionic). However its keeps on failing at a certain point which I have not gotten past. Here is the log. I have already tried the releases and git clone releases.

  GEN      src/libostree/ostree-enumtypes.h
  GEN      src/libostree/ostree-enumtypes.c
make  all-recursive
make[1]: Entering directory '/mnt/sda4/git/libostree-2020.3'
Making all in .
make[2]: Entering directory '/mnt/sda4/git/libostree-2020.3'
  CC       src/libostree/bupsplit.lo
mkdir -p src/ostree/
  GEN      src/ostree/parse-datetime.c
  CC       src/libostree/tests_test_rollsum_cli-ostree-rollsum.o
  CC       tests/tests_test_rollsum_cli-test-rollsum-cli.o
  CC       src/ostree/ostree_trivial_httpd-ostree-trivial-httpd.o
mkdir -p tests/
  GEN      tests/libreaddir-rand.so
  CC       src/libostree/libostree_1_la-ostree-async-progress.lo
  CC       src/libostree/libostree_1_la-ostree-cmdprivate.lo
  CC       src/libostree/libostree_1_la-ostree-core.lo
  CC       src/libostree/libostree_1_la-ostree-dummy-enumtypes.lo
  CC       src/libostree/libostree_1_la-ostree-checksum-input-stream.lo
  CC       src/libostree/libostree_1_la-ostree-chain-input-stream.lo
  CC       src/libostree/libostree_1_la-ostree-lzma-common.lo
  CC       src/libostree/libostree_1_la-ostree-lzma-compressor.lo
  CC       src/libostree/libostree_1_la-ostree-lzma-decompressor.lo
  CC       src/libostree/libostree_1_la-ostree-rollsum.lo
  CC       src/libostree/libostree_1_la-ostree-varint.lo
  CC       src/libostree/libostree_1_la-ostree-linuxfsutil.lo
  CC       src/libostree/libostree_1_la-ostree-diff.lo
  CC       src/libostree/libostree_1_la-ostree-mutable-tree.lo
  CC       src/libostree/libostree_1_la-ostree-ref.lo
  CC       src/libostree/libostree_1_la-ostree-remote.lo
  CC       src/libostree/libostree_1_la-ostree-repo.lo
  CC       src/libostree/libostree_1_la-ostree-repo-checkout.lo
  CC       src/libostree/libostree_1_la-ostree-repo-commit.lo
  CC       src/libostree/libostree_1_la-ostree-repo-pull.lo
src/libostree/ostree-repo-pull.c: In function ‘ostree_repo_pull_with_options’:
src/libostree/ostree-repo-pull.c:3592:15: warning: variable ‘the_ref_to_fetch’ set but not used [-Wunused-but-set-variable]
   const char *the_ref_to_fetch = NULL;
               ^~~~~~~~~~~~~~~~
  CC       src/libostree/libostree_1_la-ostree-repo-libarchive.lo
  CC       src/libostree/libostree_1_la-ostree-repo-prune.lo
  CC       src/libostree/libostree_1_la-ostree-repo-refs.lo
  CC       src/libostree/libostree_1_la-ostree-repo-traverse.lo
  CC       src/libostree/libostree_1_la-ostree-repo-file.lo
  CC       src/libostree/libostree_1_la-ostree-repo-file-enumerator.lo
  CC       src/libostree/libostree_1_la-ostree-sepolicy.lo
  CC       src/libostree/libostree_1_la-ostree-sysroot.lo
  CC       src/libostree/libostree_1_la-ostree-sysroot-cleanup.lo
  CC       src/libostree/libostree_1_la-ostree-sysroot-deploy.lo
  CC       src/libostree/libostree_1_la-ostree-sysroot-upgrader.lo
  CC       src/libostree/libostree_1_la-ostree-impl-system-generator.lo
  CC       src/libostree/libostree_1_la-ostree-bootconfig-parser.lo
  CC       src/libostree/libostree_1_la-ostree-deployment.lo
  CC       src/libostree/libostree_1_la-ostree-bootloader.lo
  CC       src/libostree/libostree_1_la-ostree-bootloader-grub2.lo
  CC       src/libostree/libostree_1_la-ostree-bootloader-zipl.lo
  CC       src/libostree/libostree_1_la-ostree-bootloader-syslinux.lo
  CC       src/libostree/libostree_1_la-ostree-bootloader-uboot.lo
  CC       src/libostree/libostree_1_la-ostree-repo-static-delta-core.lo
  CC       src/libostree/libostree_1_la-ostree-repo-static-delta-processing.lo
  CC       src/libostree/libostree_1_la-ostree-repo-static-delta-compilation.lo
  CC       src/libostree/libostree_1_la-ostree-repo-static-delta-compilation-analysis.lo
  CC       src/libostree/libostree_1_la-ostree-bloom.lo
  CC       src/libostree/libostree_1_la-ostree-repo-finder.lo
  CC       src/libostree/libostree_1_la-ostree-repo-finder-avahi.lo
  CC       src/libostree/libostree_1_la-ostree-repo-finder-config.lo
  CC       src/libostree/libostree_1_la-ostree-repo-finder-mount.lo
  CC       src/libostree/libostree_1_la-ostree-repo-finder-override.lo
  CC       src/libostree/libostree_1_la-ostree-kernel-args.lo
  CC       src/libostree/libostree_1_la-ostree-libarchive-input-stream.lo
  CC       src/libostree/libostree_1_la-ostree-tls-cert-interaction.lo
  CC       src/libostree/libostree_1_la-ostree-repo-finder-avahi-parser.lo
  CC       src/libostree/libostree_1_la-ostree-gpg-verifier.lo
  CC       src/libostree/libostree_1_la-ostree-gpg-verify-result.lo
  CC       src/libostree/libostree_1_la-ostree-fetcher-util.lo
  CC       src/libostree/libostree_1_la-ostree-fetcher-uri.lo
  CC       src/libostree/libostree_1_la-ostree-metalink.lo
  CC       src/libostree/libostree_1_la-ostree-fetcher-soup.lo
  CC       src/libostree/libostree_1_la-ostree-enumtypes.lo
  CC       src/libotutil/libotutil_la-ot-checksum-utils.lo
  CC       src/libotutil/libotutil_la-ot-checksum-instream.lo
  CC       src/libotutil/libotutil_la-ot-fs-utils.lo
  CC       src/libotutil/libotutil_la-ot-keyfile-utils.lo
  CC       src/libotutil/libotutil_la-ot-opt-utils.lo
  CC       src/libotutil/libotutil_la-ot-unix-utils.lo
  CC       src/libotutil/libotutil_la-ot-variant-utils.lo
  CC       src/libotutil/libotutil_la-ot-variant-builder.lo
  CC       src/libotutil/libotutil_la-ot-gio-utils.lo
  CC       src/libotutil/libotutil_la-ot-tool-util.lo
  CC       src/libotutil/libotutil_la-ot-gpg-utils.lo
  CC       libglnx/libglnx_la-glnx-backports.lo
  CC       libglnx/libglnx_la-glnx-local-alloc.lo
  CC       libglnx/libglnx_la-glnx-errors.lo
  CC       libglnx/libglnx_la-glnx-console.lo
  CC       libglnx/libglnx_la-glnx-dirfd.lo
  CC       libglnx/libglnx_la-glnx-fdio.lo
  CC       libglnx/libglnx_la-glnx-lockfile.lo
  CC       libglnx/libglnx_la-glnx-xattrs.lo
  CC       libglnx/libglnx_la-glnx-shutil.lo
  CC       bsdiff/libbsdiff_la-bsdiff.lo
  CC       bsdiff/libbsdiff_la-bspatch.lo
  CCLD     libbupsplit.la
  CC       tests/libostreetest_la-libostreetest.lo
  CC       tests/libostreetest_la-test-mock-gio.lo
ar: `u' modifier ignored since `D' is the default (see `U')
  CC       src/ostree/ostree-main.o
  CC       src/ostree/ostree-ot-builtin-admin.o
  CC       src/ostree/ostree-ot-builtin-cat.o
  CC       src/ostree/ostree-ot-builtin-config.o
  CC       src/ostree/ostree-ot-builtin-checkout.o
  CC       src/ostree/ostree-ot-builtin-checksum.o
  CC       src/ostree/ostree-ot-builtin-commit.o
  CC       src/ostree/ostree-ot-builtin-create-usb.o
  CC       src/ostree/ostree-ot-builtin-diff.o
  CC       src/ostree/ostree-ot-builtin-export.o
  CC       src/ostree/ostree-ot-builtin-find-remotes.o
  CC       src/ostree/ostree-ot-builtin-fsck.o
  CC       src/ostree/ostree-ot-builtin-init.o
  CC       src/ostree/ostree-ot-builtin-pull-local.o
  CC       src/ostree/ostree-ot-builtin-log.o
  CC       src/ostree/ostree-ot-builtin-ls.o
  CC       src/ostree/ostree-ot-builtin-prune.o
  CC       src/ostree/ostree-ot-builtin-refs.o
  CC       src/ostree/ostree-ot-builtin-remote.o
  CC       src/ostree/ostree-ot-builtin-reset.o
  CC       src/ostree/ostree-ot-builtin-rev-parse.o
  CC       src/ostree/ostree-ot-builtin-summary.o
  CC       src/ostree/ostree-ot-builtin-show.o
  CC       src/ostree/ostree-ot-builtin-static-delta.o
  CC       src/ostree/ostree-ot-main.o
  CC       src/ostree/ostree-ot-dump.o
  CC       src/ostree/ostree-ot-editor.o
  CC       src/ostree/ostree-ot-builtin-gpg-sign.o
  CC       src/ostree/ostree-ot-admin-builtin-init-fs.o
  CC       src/ostree/ostree-ot-admin-builtin-diff.o
  CC       src/ostree/ostree-ot-admin-builtin-deploy.o
  CC       src/ostree/ostree-ot-admin-builtin-finalize-staged.o
  CC       src/ostree/ostree-ot-admin-builtin-undeploy.o
  CC       src/ostree/ostree-ot-admin-builtin-instutil.o
  CC       src/ostree/ostree-ot-admin-builtin-cleanup.o
  CC       src/ostree/ostree-ot-admin-builtin-os-init.o
  CC       src/ostree/ostree-ot-admin-builtin-set-origin.o
  CC       src/ostree/ostree-ot-admin-builtin-status.o
  CC       src/ostree/ostree-ot-admin-builtin-switch.o
  CC       src/ostree/ostree-ot-admin-builtin-pin.o
  CC       src/ostree/ostree-ot-admin-builtin-upgrade.o
  CC       src/ostree/ostree-ot-admin-builtin-unlock.o
  CC       src/ostree/ostree-ot-admin-instutil-builtin-selinux-ensure-labeled.o
  CC       src/ostree/ostree-ot-admin-instutil-builtin-set-kargs.o
  CC       src/ostree/ostree-ot-admin-instutil-builtin-grub2-generate.o
  CC       src/ostree/ostree-ot-admin-functions.o
  CC       src/ostree/ostree-ot-remote-builtin-add.o
  CC       src/ostree/ostree-ot-remote-builtin-delete.o
  CC       src/ostree/ostree-ot-remote-builtin-list.o
  CC       src/ostree/ostree-ot-remote-builtin-show-url.o
  CC       src/ostree/ostree-ot-remote-builtin-refs.o
  CC       src/ostree/ostree-ot-remote-builtin-summary.o
  CC       src/ostree/ostree-ot-remote-builtin-gpg-import.o
  CC       src/ostree/ostree-ot-remote-builtin-add-cookie.o
  CC       src/ostree/ostree-ot-remote-builtin-delete-cookie.o
  CC       src/ostree/ostree-ot-remote-builtin-list-cookies.o
  CC       src/ostree/ostree-ot-remote-cookie-util.o
  CC       src/ostree/ostree-ot-builtin-pull.o
  CC       src/ostree/ostree-ot-builtin-trivial-httpd.o
  CC       src/ostree/ostree-parse-datetime.o
  CC       src/rofiles-fuse/rofiles_fuse-main.o
  CC       src/switchroot/ostree_prepare_root-ostree-prepare-root.o
  CCLD     libotutil.la
ar: `u' modifier ignored since `D' is the default (see `U')
  CCLD     libglnx.la
  CCLD     libbsdiff.la
  CCLD     ostree-prepare-root
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
  CCLD     libostree-1.la
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgpgme.a(debug.o): relocation R_X86_64_TPOFF32 against `frame_nr' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:3349: recipe for target 'libostree-1.la' failed
make[2]: *** [libostree-1.la] Error 1
make[2]: Leaving directory '/mnt/sda4/git/libostree-2020.3'
Makefile:7339: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/mnt/sda4/git/libostree-2020.3'
Makefile:2920: recipe for target 'all' failed
make: *** [all] Error 2
cgwalters commented 4 years ago

Seeing which compiler flags you're using would help (i.e. make V=1). I would recommend using the existing Debian package as a reference point: https://packages.debian.org/buster/ostree

Using -fPIC should be the default injected by libtool when building shared libraries, so your toolchain seems like it's doing something wrong.