Mail archive
alpine-devel

Re: [alpine-devel] Porting Alpine scripts

From: Timo Teras <timo.teras_at_iki.fi>
Date: Mon, 21 Nov 2016 10:59:25 +0200

On Mon, 21 Nov 2016 07:39:27 +0700
"Tuan M. Hoang" <tmhoang_at_flatglobe.org> wrote:

> I see that you didn't provide linux-grsec/config-grsec.aarch64. grsec
> does not support aarch64 neither? I have read some grsec patch and it
> looks like they do provide some s390/s390x patch like this one :
> http://dev.alpinelinux.org/~ncopa/grsec/grsecurity-3.1-4.4.32-201604252206-alpine.patch
> I am not sure is this called "supported".

Yes, aarch64 is not supported to my knowledge.

But indeed there seems to be s390 support in grsec. Feel free to look
at it, and enable a grsec config for it.

> Actually according to the log above, $ paxctl are those failed
> (ret=1). I will try to strace them this week.

Ok.

> > I would be happy to pick up some of these patches already now. Would
> > you be able to give them exported with "git format-patch" so you get
> > annotated as author and the commit log is preserved.
> >
> > I could try bootstrap s390 too then and see if the same problem
> > happens and analyze it a bit more.
> >
> > In any case I recently fixed the bootstrap script and few aports. I
> > was able to bootstrap again git master for armv7.
> >
> Please find my patches in the attachments. There were some small
> changes that I did not include in those patches because I think it
> only (temporarily) affects my build. So I list here fyi:
> - scripts/bootstrap.sh : linux-headers & zlib-dev need to be
> explicitly installed (besides fortify-headers, libc-dev, build-base)
> even though linux-headers is zlib's makedends, zlib-dev is binutils's
> makedepends.
>
> If there was any problem, please kindly let me know.

I applied apk-tools patch to both aports, and apk-tools git. I also
took parts of aports/gcc patch (the s390 specific config).
linux-headers patch was applied as is.

I'm still looking at the rest of the patches. Here's my review thoughts
of them:

- aports/gcc, moving the libgcc_s.so symlink is probably not the right
  solution. We prefer to keep that in the main 'gcc' package. During
  cross-build it should work so that the 'gcc-s390x' cross-build
  package has this in usr/s390x-alpine-linux-musl/lib/libgcc_s.so. Now
  it breaks because on other arch's this is in reality a linker script
  and not a symlink. The linker script enables gcc to search for the
  right file from all of the libpath again. But s390 is having it as
  symlink, and breaks because the actual file is relocated to the
  sysroot. I am not fully sure what to do here. I might lean on just
  overwriting the cross compiler's libgcc_s.so to be a while with
  contents:
  GROUP ( libgcc_s.so.1 -lgcc )

  I'll think about it a bit more, and can push a fix later today for it.

- aports/linux-vanilla looks good. Though you probably just got the
  kernel config from some other linux distro? It would probably be good
  to cross-check that with other Alpine's linux-vanilla configs to see
  that it is more or less in harmony.

- aports/musl looks mostly ok. We hope musl would soon make release,
  and much of the patch is not needed then as it's mostly upstreamed
  now. There's one issue that's causing some of your trouble. The
  following hunk is wrong:

_at_@ -142,6 +146,7 @@ compat() {
         mips*) _ld="ld.so.1" ;;
+ s390*) _ld="ld-musl-s390x.so.1" ;;

  The compat package is supposed to create symlinks that mimic glibc
  provided ld and libraries. The _ld var needs to be setup to be the
  glibc ld name, not the musl one. Looking at gcc, the proper thing
  here to do is:
- mips*) _ld="ld.so.1" ;;
+ mips* | s390*) _ld="ld.so.1" ;;

- In main/libressl you add --disable-asm? Why is this needed?
  It seemed to compile just fine without this flag. If really needed,
  this should be made conditional so that it's only applied for s390.

- The bootstrap script changes should not be needed after the above
  fixes.

Thanks for working on this! It's starting to look pretty good, and with
the few tweaks above and after musl release, I think we are good to
commit all of the required changes.

Cheers,
Timo






---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Mon Nov 21 2016 - 10:59:25 UTC