Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crosscompiling for Aarch64 #668

Open
phodina opened this issue Oct 30, 2021 · 2 comments
Open

Crosscompiling for Aarch64 #668

phodina opened this issue Oct 30, 2021 · 2 comments

Comments

@phodina
Copy link

phodina commented Oct 30, 2021

Hi,

I've attempted to cross-compile the liblockdev pkg for Aarch64. However, there seems to be some issue with the linker, see the attached log. I'm running version 2.25 on Guix (x86_64 builds ok).

Any ideas what could be the cause?

...
libtool: link: (cd ".libs" && rm -f "libblockdev.so.2" && ln -s "libblockdev.so.2.0.0" "libblockdev.so.2")
libtool: link: (cd ".libs" && rm -f "libblockdev.so" && ln -s "libblockdev.so.2.0.0" "libblockdev.so")
libtool: link: ( cd ".libs" && rm -f "libblockdev.la" && ln -s "../libblockdev.la" "libblockdev.la" )
CPPFLAGS="" CFLAGS="-std=gnu99" LDFLAGS="" CC="gcc" PKG_CONFIG="/gnu/store/hjqd2irmhgdb0kcbxaciar8vkkhkb62i-pkg-config-0.29.2/bin/pkg-config" GI_HOST_OS="" DLLTOOL="false"  /gnu/store/ss8gavskrmzy73ycbhcd25xkyxlij3iq-gobject-introspection-1.62.0/bin/g-ir-scanner   --namespace=BlockDev --nsversion=2.0 --libtool="/gnu/store/7sfbiqh21h90bc6zi8br1xh60m6qgdd5-bash-minimal-5.0.16/bin/bash ../../libtool"  --include=GObject-2.0 --include=Gio-2.0 --pkg-export=blockdev   --library=libblockdev.la --warn-error --warn-all --identifier-prefix=BD --symbol-prefix=bd --cflags-begin -I./../../include/ --cflags-end -L./../utils/ -lbd_utils plugin_apis/kbd.h plugin_apis/mdraid.h plugin_apis/swap.h plugin_apis/btrfs.h plugin_apis/lvm.h plugin_apis/crypto.h plugin_apis/dm.h plugin_apis/loop.h plugin_apis/mpath.h plugin_apis/part.h plugin_apis/fs.h plugin_apis/nvdimm.h plugin_apis/vdo.h ../utils/dbus.c ../utils/dbus.h ../utils/dev_utils.c ../utils/dev_utils.h ../utils/exec.c ../utils/exec.h ../utils/extra_arg.c ../utils/extra_arg.h ../utils/module.c ../utils/module.h ../utils/sizes.h ../utils/utils.h blockdev.c blockdev.h plugins.c plugins.h libblockdev.la --output BlockDev-2.0.gir
g-ir-scanner: link: /gnu/store/7sfbiqh21h90bc6zi8br1xh60m6qgdd5-bash-minimal-5.0.16/bin/bash ../../libtool --mode=link --tag=CC gcc -o /tmp/guix-build-libblockdev-2.25.drv-0/libblockdev-2.25/src/lib/tmp-introspectpzwfz3ob/BlockDev-2.0 -export-dynamic -std=gnu99 /tmp/guix-build-libblockdev-2.25.drv-0/libblockdev-2.25/src/lib/tmp-introspectpzwfz3ob/BlockDev-2.0.o -L. -L./../utils/ libblockdev.la -lbd_utils -L/gnu/store/7ck18v90sbhsk6f7b0wpghhk1d82ydxf-glib-2.62.6/lib -lgio-2.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0
libtool: link: gcc -o /tmp/guix-build-libblockdev-2.25.drv-0/libblockdev-2.25/src/lib/tmp-introspectpzwfz3ob/.libs/BlockDev-2.0 -std=gnu99 /tmp/guix-build-libblockdev-2.25.drv-0/libblockdev-2.25/src/lib/tmp-introspectpzwfz3ob/BlockDev-2.0.o -Wl,--export-dynamic -pthread -Wl,--export-dynamic  -L. -L./../utils/ ./.libs/libblockdev.so -L/gnu/store/7ck18v90sbhsk6f7b0wpghhk1d82ydxf-glib-2.62.6/lib -L/gnu/store/d9n1r1mqms9a38rj08d76l8ndvxcw6zh-eudev-3.2.9/lib -L/gnu/store/hx0a8xyq5f06a70970c7jny61xya1r7r-kmod-27/lib -L/gnu/store/bf6jynpqhxd9d0jsdc3pwplzjg8rv4r7-xz-5.2.4/lib -L/gnu/store/ykpl063z85l7949ha3d730gwvnwixxkj-zlib-1.2.11/lib -ldl /tmp/guix-build-libblockdev-2.25.drv-0/libblockdev-2.25/src/utils/.libs/libbd_utils.so -lm /gnu/store/d9n1r1mqms9a38rj08d76l8ndvxcw6zh-eudev-3.2.9/lib/libudev.so /gnu/store/hx0a8xyq5f06a70970c7jny61xya1r7r-kmod-27/lib/libkmod.so /gnu/store/bf6jynpqhxd9d0jsdc3pwplzjg8rv4r7-xz-5.2.4/lib/liblzma.so -lz -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -pthread -Wl,-rpath -Wl,/gnu/store/daf17bj7a01cibd8zh0i8wsj7vwbpkd1-libblockdev-2.25/lib -Wl,-rpath -Wl,/gnu/store/d9n1r1mqms9a38rj08d76l8ndvxcw6zh-eudev-3.2.9/lib -Wl,-rpath -Wl,/gnu/store/hx0a8xyq5f06a70970c7jny61xya1r7r-kmod-27/lib -Wl,-rpath -Wl,/gnu/store/bf6jynpqhxd9d0jsdc3pwplzjg8rv4r7-xz-5.2.4/lib
ldd: exited with unknown exit code (139)
Traceback (most recent call last):
  File "/gnu/store/ss8gavskrmzy73ycbhcd25xkyxlij3iq-gobject-introspection-1.62.0/bin/g-ir-scanner", line 100, in <module>
    sys.exit(scanner_main(sys.argv))
  File "/gnu/store/ss8gavskrmzy73ycbhcd25xkyxlij3iq-gobject-introspection-1.62.0/lib/gobject-introspection/giscanner/scannermain.py", line 616, in scanner_main
    shlibs = create_binary(transformer, options, args)
  File "/gnu/store/ss8gavskrmzy73ycbhcd25xkyxlij3iq-gobject-introspection-1.62.0/lib/gobject-introspection/giscanner/scannermain.py", line 456, in create_binary
    shlibs = resolve_shlibs(options, binary, options.libraries)
  File "/gnu/store/ss8gavskrmzy73ycbhcd25xkyxlij3iq-gobject-introspection-1.62.0/lib/gobject-introspection/giscanner/shlibs.py", line 180, in resolve_shlibs
    _resolve_non_libtool(options, binary, non_libtool))
  File "/gnu/store/ss8gavskrmzy73ycbhcd25xkyxlij3iq-gobject-introspection-1.62.0/lib/gobject-introspection/giscanner/shlibs.py", line 112, in _resolve_non_libtool
    output = subprocess.check_output(args)
  File "/gnu/store/mdqbngwbkpwxdpisw5167vq9jyfn85y8-python-3.8.2/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/gnu/store/mdqbngwbkpwxdpisw5167vq9jyfn85y8-python-3.8.2/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/gnu/store/7sfbiqh21h90bc6zi8br1xh60m6qgdd5-bash-minimal-5.0.16/bin/bash', '../../libtool', '--mode=execute', 'ldd', '/tmp/guix-build-libblockdev-2.25.drv-0/libblockdev-2.25/src/lib/tmp-introspectpzwfz3ob/BlockDev-2.0']' returned non-zero exit status 1.
make[3]: *** [/gnu/store/ss8gavskrmzy73ycbhcd25xkyxlij3iq-gobject-introspection-1.62.0/share/gobject-introspection-1.0/Makefile.introspection:156: BlockDev-2.0.gir] Error 1
make[3]: Leaving directory '/tmp/guix-build-libblockdev-2.25.drv-0/libblockdev-2.25/src/lib'
make[2]: *** [Makefile:734: all-recursive] Error 1
make[2]: Leaving directory '/tmp/guix-build-libblockdev-2.25.drv-0/libblockdev-2.25/src/lib'
make[1]: *** [Makefile:431: all-recursive] Error 1
make[1]: Leaving directory '/tmp/guix-build-libblockdev-2.25.drv-0/libblockdev-2.25/src'
make: *** [Makefile:508: all-recursive] Error 1
command "make" "-j" "16" failed with status 2
@tbzatek
Copy link
Member

tbzatek commented Nov 1, 2021

Nothing specific here, looks like g-ir-scanner is calling libtool to link the generated sources but I don't see any real error message in the output. You may try compiling with make V=1 -j1 but that's a long shot.

Alternatively, just switch to /tmp/guix-build-libblockdev-2.25.drv-0/libblockdev-2.25/src/lib and call the libtool command manually. Perhaps it'll give you more precise error message.

@phodina
Copy link
Author

phodina commented Nov 4, 2021

Thanks @tbzatek ! I'll try the flag and without parallel build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants