tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

GNU linux platform MACHINE_GNU_PLATFORM and/or LIBABIPREFIX



Not accustomed at all to GNU Linux, so I've some questions about what could/should be in platform/Linux.mk

on ubuntu64 for aarch64, linaro is building the gcc tool chain with:
> richard@odroid64:/home/richard/src/pkgsrc$ gcc -v
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/5/lto-wrapper
> Target: aarch64-linux-gnu
> Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.2' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-arm64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-arm64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-arm64 --with-arch-directory=aarch64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werr
 o
r --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
> Thread model: posix
> gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.2) 

which means 
> richard@odroid64:/home/richard/src/pkgsrc$ gcc -print-multiarchaarch64-linux-gnu
> richard@odroid64:/home/richard/src/pkgsrc$ gcc -dumpmachine
> aarch64-linux-gnu
> richard@odroid64:/home/richard/src/pkgsrc$ cat /etc/ld.so.conf.d/aarch64-linux-gnu.conf 
> # Multiarch support
> /lib/aarch64-linux-gnu
> /usr/lib/aarch64-linux-gnu
> richard@odroid64:/home/richard/src/pkgsrc$ /lib/aarch64-linux-gnu/libc.so.6 
> GNU C Library (Ubuntu GLIBC 2.23-0ubuntu3) stable release version 2.23, by Roland McGrath et al.
> Copyright (C) 2016 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.
> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
> PARTICULAR PURPOSE.
> Compiled by GNU CC version 5.3.1 20160413.
> Available extensions:
> 	crypt add-on version 2.1 by Michael Glad and others
> 	GNU Libidn by Simon Josefsson
> 	Native POSIX Threads Library by Ulrich Drepper et al
> 	BIND-8.2.3-T5B
> libc ABIs: UNIQUE
> For bug reporting instructions, please see:
> <https://bugs.launchpad.net/ubuntu/+source/glibc/+bugs>.

to be able to pick up the GLIBC_VERSION, I updated my recent patch to platform/Linux.mk
> richard@odroid64:/home/richard/src/pkgsrc$ git diff mk/platform/
> diff --git a/mk/platform/Linux.mk b/mk/platform/Linux.mk
> index 5762e34..46e7386 100644
> --- a/mk/platform/Linux.mk
> +++ b/mk/platform/Linux.mk
> @@ -67,9 +67,10 @@ _OPSYS_SYSTEM_RPATH= /lib${LIBABISUFFIX}:/usr/lib${LIBABISUFFIX}:/lib/arm-linux-
>  _OPSYS_LIB_DIRS?=      /lib${LIBABISUFFIX} /usr/lib${LIBABISUFFIX} /lib/arm-linux-gnueabi /usr/lib/arm-linux-gnueabi
>  .endif
>  .endif
> -.if !empty(MACHINE_ARCH:Maarch64*)
> -_OPSYS_SYSTEM_RPATH=   /lib${LIBABISUFFIX}:/usr/lib${LIBABISUFFIX}:/lib/aarch64-linux-gnu:/usr/lib/aarch64-linux-gnu
> -_OPSYS_LIB_DIRS?=      /lib${LIBABISUFFIX} /usr/lib${LIBABISUFFIX} /lib/aarch64-linux-gnu /usr/lib/aarch64-linux-gnu
> +.if !empty(MACHINE_ARCH:Maarch64)
> +LIBABISUFFIX?=         /aarch64-linux-gnu
> +_OPSYS_SYSTEM_RPATH=   /lib:/usr/lib:/lib${LIBABISUFFIX}:/usr/lib${LIBABISUFFIX}
> +_OPSYS_LIB_DIRS?=      /lib /usr/lib /lib${LIBABISUFFIX} /usr/lib${LIBABISUFFIX}
>  .endif
>  .else
>  _OPSYS_SYSTEM_RPATH=   /lib${LIBABISUFFIX}:/usr/lib${LIBABISUFFIX}

Now I get a valid value:
> richard@odroid64:/home/richard/src/pkgsrc/devel/check$ bmake show-var VARNAME=GLIBC_VERSION
> 2.23

So I presume this is a valid case for LIBABISUFFIX...

unfortunately, pkgsrc seems to automatically choose a different MACHINE_GNU_PLATFORM
> richard@odroid64:/home/richard/src/pkgsrc/devel/check$ bmake show-var VARNAME=MACHINE_GNU_PLATFORM
> aarch64-debian-linux
which is passed in via the build triplet

Why 'debian' in there, is that 'standard'? 

As far as the native toolchain goes, they are found as /usr/bin/aarch64-linux-gnu-{addr2line, ar, ...}
where /usr/bin/{addr2line,ar,...} are symlinks.

In any event, is it proper to set MACHINE_GNU_PLATFORM directly in platform?
Or is this something that should go in mk.conf?  Am I missing the point somerwhere?

BTW, as to _OPSYS_SYSTEM_RPATH and _OPSYS_LIB_DIRS, there seems to be a pattern
(with LIBABISUFFIX) involving '${MACHINE_ARCH}-${LOWER_OPSYS}-gnu${APPEND_ABI}'
If that's so, then perhaps platform/Linux.mk could be somewhat simplified.

thanks in advance for some linux guidance
-- 
Richard PALO




Home | Main Index | Thread Index | Old Index