Mail archive
alpine-devel

Re: [alpine-devel] Porting Alpine scripts

From: Tuan M. Hoang <tmhoang_at_flatglobe.org>
Date: Sat, 28 Jan 2017 20:00:29 -0500

On Fri, 27 Jan 2017 09:00:54 +0200
Timo Teras <timo.teras_at_iki.fi> wrote:
>
> If fakeroot segfaults you'll end up in trouble sooner or later. It'd
> be good to fix that. Do you have strace or gdb backtrace of the
> crash?

Cross-compiling strace and gdb requires 'linux-headers'
installed in $CBUILDROOT. strace is cool but gdb still fails
for me with following errors :

In file included from gregset.h:26:0,
                 from s390-linux-nat.c:28:
nm.h:23:24: error: 'elf_gregset_t' does not name a type
 #define GDB_GREGSET_T elf_gregset_t
                        ^
gregset.h:36:9: note: in expansion of macro 'GDB_GREGSET_T'
 typedef GDB_GREGSET_T gdb_gregset_t;
         ^~~~~~~~~~~~~
nm.h:24:24: error: 'elf_fpregset_t' does not name a type
 #define GDB_FPREGSET_T elf_fpregset_t
                        ^
gregset.h:37:9: note: in expansion of macro 'GDB_FPREGSET_T'
 typedef GDB_FPREGSET_T gdb_fpregset_t;
         ^~~~~~~~~~~~~~
In file included from s390-linux-nat.c:28:0:
gregset.h:52:14: error: 'gdb_gregset_t' does not name a type
        const gdb_gregset_t *gregs);
              ^~~~~~~~~~~~~
gregset.h:54:15: error: 'gdb_fpregset_t' does not name a type
         const gdb_fpregset_t *fpregs);
               ^~~~~~~~~~~~~~
gregset.h:61:6: error: 'gdb_gregset_t' has not been declared
      gdb_gregset_t *gregs, int regno);
      ^~~~~~~~~~~~~
gregset.h:63:7: error: 'gdb_fpregset_t' has not been declared
       gdb_fpregset_t *fpregs, int regno);
       ^~~~~~~~~~~~~~

elf_gregset_t and elf_fpregset_t were supposed to be defined in
https://github.com/torvalds/linux/blob/master/arch/s390/include/asm/elf.h
and I think it should be built in 'linux-headers', but no trace of them.

Here is the log of strace fakeroot : http://pastebin.com/Pn7YUWRz

> > 2. I was having an error when building linux-vanilla-dev ( with
> > above kernel config ). When running $ make in dev() in APKBUILD,
> > HOSTCC compiles some scripts in "$srcdir"/linux-$_kernver/scripts
> > directory into host arch (x86_64) object/exec files. These files
> > were later get copied into
> > "$subpkgdir"/usr/src/linux-headers-${_abi_release}
> > (aports/main/linux-vanilla/pkg/linux-vanilla-dev/usr/src/linux-headers-4.4.34).
> > Then libc.musl-x86_64.so.1 comes up in as a needed .so file in
> > later steps (scan_shared_objects() function). This happens for
> > linux-vanilla-dev package, while bootstraping both aarch64, and
> > s390x using aports master.
>
> This is tricky. Should the -dev package be built for the target or for
> the build host. When cross-compiling it should probably be built for
> the build host. Because it will probably be used to build the modules
> too. Maybe the following change in linux-vanilla will fix it:
> -subpackages="$pkgname-dev"
> +subpackages="$pkgname-dev::$CBUILD_ARCH"
>
This indeed fixes it and makes linux-vanilla-dev a HOST's package.

Thank you,
Tuan



---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Sat Jan 28 2017 - 20:00:29 GMT