All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] systemd: build failure against pam on arm
@ 2017-06-01  2:29 Christian Stewart
  2017-06-01 18:36 ` Christian Stewart
  2017-06-01 22:03 ` Peter Korsgaard
  0 siblings, 2 replies; 24+ messages in thread
From: Christian Stewart @ 2017-06-01  2:29 UTC (permalink / raw)
  To: buildroot

Hi all,

Compiling against 2017.05, with the following defconfig:

BR2_arm=y
BR2_cortex_a15=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_OPTIMIZE_2=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_INIT_SYSTEMD=y
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_LINUX_PAM=y

I get this error consistently during the systemd compilation when PAM
is enabled:

/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
error: /lib/libpam.so: incompatible target
/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
error: /lib/libpam_misc.so: incompatible target
collect2: error: ld returned 1 exit status

It looks like it's attempting to link against /lib/libpam.so from my system.

This is a pretty huge showstopper!

Thanks,
Christian Stewart

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-06-01  2:29 [Buildroot] systemd: build failure against pam on arm Christian Stewart
@ 2017-06-01 18:36 ` Christian Stewart
  2017-06-01 22:03 ` Peter Korsgaard
  1 sibling, 0 replies; 24+ messages in thread
From: Christian Stewart @ 2017-06-01 18:36 UTC (permalink / raw)
  To: buildroot

Hi All,

On Wed, May 31, 2017 at 7:29 PM, Christian Stewart <christian@paral.in> wrote:
> Compiling against 2017.05
> /output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
> error: /lib/libpam.so: incompatible target
> /output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
> error: /lib/libpam_misc.so: incompatible target
> collect2: error: ld returned 1 exit status


I have bisected the issue down to this commit:

400eaa3452e9380ec77ac62266530055506ea6e7 is the first bad commit
commit 400eaa3452e9380ec77ac62266530055506ea6e7
Author: Fabio Estevam <festevam@gmail.com>
Date:   Mon Feb 20 08:57:33 2017 -0300

    linux: bump default to version 4.10

    Signed-off-by: Fabio Estevam <festevam@gmail.com>
    Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

:040000 040000 126b4402798481ff4f718cffc974f612c3f374f3
07e93971d57d6f591d0ba4c957febb048fda48ef M      linux

Bisecting using this script:

probe-issue.bash:

#!/bin/bash
set -eo pipefail
make clean
cat > defconfig <<'_EOF'
BR2_arm=y
BR2_cortex_a15=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_OPTIMIZE_2=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_INIT_SYSTEMD=y
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_LINUX_PAM=y
_EOF
make defconfig BR2_DEFCONFIG=defconfig
make systemd

buildroot:

git bisect run ../probe-issue.bash

Reliable failure is systemd attempting to link against /lib/libpam.so.

Thanks,
Christian Stewart

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-06-01  2:29 [Buildroot] systemd: build failure against pam on arm Christian Stewart
  2017-06-01 18:36 ` Christian Stewart
@ 2017-06-01 22:03 ` Peter Korsgaard
  2017-06-01 23:35   ` Christian Stewart
  1 sibling, 1 reply; 24+ messages in thread
From: Peter Korsgaard @ 2017-06-01 22:03 UTC (permalink / raw)
  To: buildroot

>>>>> "Christian" == Christian Stewart <christian@paral.in> writes:

 > Hi all,
 > Compiling against 2017.05, with the following defconfig:

 > BR2_arm=y
 > BR2_cortex_a15=y
 > BR2_ARM_FPU_NEON_VFPV4=y
 > BR2_OPTIMIZE_2=y
 > BR2_TOOLCHAIN_EXTERNAL=y
 > BR2_INIT_SYSTEMD=y
 > # BR2_TARGET_ROOTFS_TAR is not set
 > BR2_PACKAGE_LINUX_PAM=y

 > I get this error consistently during the systemd compilation when PAM
 > is enabled:

 > /output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
 > error: /lib/libpam.so: incompatible target
 > /output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
 > error: /lib/libpam_misc.so: incompatible target
 > collect2: error: ld returned 1 exit status

 > It looks like it's attempting to link against /lib/libpam.so from my system.

Can you paste a few more lines above this error?

I cannot reproduce it here, not even after install libpam0g-dev on my
build host.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-06-01 22:03 ` Peter Korsgaard
@ 2017-06-01 23:35   ` Christian Stewart
  2017-06-03  2:48     ` Christian Stewart
  0 siblings, 1 reply; 24+ messages in thread
From: Christian Stewart @ 2017-06-01 23:35 UTC (permalink / raw)
  To: buildroot

Hi Peter,

On Thu, Jun 1, 2017 at 3:03 PM, Peter Korsgaard <peter@korsgaard.com> wrote:
> Can you paste a few more lines above this error?

Here:

>>> systemd 233 Building
PATH="/home/hristian/jpl_skiff/skiff/buildroot-work/output/host/bin:/home/hristian/jpl_skiff/skiff/buildroot-work/output/host/sbin:/home/hristian/jpl_skiff/skiff/buildroot-work/output/host/usr/bin:/home/hristian/jpl_skiff/skiff/buildroot-work/output/host/usr/sbin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0:/home/hristian/go/bin:/home/hristian/.powerline/scripts"
 /usr/bin/make -j17  -C
/home/hristian/jpl_skiff/skiff/buildroot-work/output/build/systemd-233/
make[1]: Entering directory
'/home/hristian/jpl_skiff/skiff/buildroot-work/output/build/systemd-233'
/usr/bin/make --no-print-directory all-recursive
Making all in .
  CCLD     libnetworkd-core.la
  CCLD     libnss_systemd.la
  CCLD     libnss_myhostname.la
  CCLD     libnss_resolve.la
  CCLD     systemd-cgtop
  CCLD     systemd-cgls
  CCLD     systemd-nspawn
  CCLD     systemd-detect-virt
  CCLD     systemd-delta
  CCLD     systemd-analyze
  CCLD     systemd-run
  CCLD     systemd-mount
  CCLD     systemd-stdio-bridge
  CCLD     systemd-path
  CCLD     hostnamectl
  CCLD     systemd-socket-activate
  CCLD     timedatectl
  CCLD     systemd-resolve
  CCLD     systemd-notify
  CCLD     systemd-ask-password
  CCLD     systemd-tty-ask-password-agent
  CCLD     systemctl
  CCLD     systemd-machine-id-setup
  CCLD     systemd-escape
  CCLD     systemd-tmpfiles
  CCLD     systemd-hwdb
  CCLD     systemd
  CCLD     systemd-cgroups-agent
  CCLD     systemd-initctl
  CCLD     systemd-remount-fs
  CCLD     systemd-volatile-root
  CCLD     systemd-reply-password
/home/hristian/jpl_skiff/skiff/buildroot-work/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
error: /lib/libpam.so: incompatible target
/home/hristian/jpl_skiff/skiff/buildroot-work/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
error: /lib/libpam_misc.so: incompatible target
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:12503: systemd-analyze] Error 1
make[3]: *** Waiting for unfinished jobs....
/home/hristian/jpl_skiff/skiff/buildroot-work/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
error: /lib/libpam.so: incompatible target
/home/hristian/jpl_skiff/skiff/buildroot-work/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
error: /lib/libpam_misc.so: incompatible target
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:12475: systemd] Error 1
make[2]: *** [Makefile:22633: all-recursive] Error 1
make[1]: *** [Makefile:10160: all] Error 2
make[1]: Leaving directory
'/home/hristian/jpl_skiff/skiff/buildroot-work/output/build/systemd-233'
make: *** [package/pkg-generic.mk:230:
/home/hristian/jpl_skiff/skiff/buildroot-work/output/build/systemd-233/.stamp_built]
Error 2

Thanks,
Christian Stewart

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-06-01 23:35   ` Christian Stewart
@ 2017-06-03  2:48     ` Christian Stewart
  2017-06-03 10:54       ` Waldemar Brodkorb
  0 siblings, 1 reply; 24+ messages in thread
From: Christian Stewart @ 2017-06-03  2:48 UTC (permalink / raw)
  To: buildroot

Hi all,

On Thu, Jun 1, 2017 at 4:35 PM, Christian Stewart <christian@paral.in> wrote:
> /home/hristian/jpl_skiff/skiff/buildroot-work/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
> error: /lib/libpam.so: incompatible target
> /home/hristian/jpl_skiff/skiff/buildroot-work/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
> error: /lib/libpam_misc.so: incompatible target
> collect2: error: ld returned 1 exit status
> make[3]: *** [Makefile:12503: systemd-analyze] Error 1
> make[3]: *** Waiting for unfinished jobs....
> /home/hristian/jpl_skiff/skiff/buildroot-work/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
> error: /lib/libpam.so: incompatible target
> /home/hristian/jpl_skiff/skiff/buildroot-work/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
> error: /lib/libpam_misc.so: incompatible target
> collect2: error: ld returned 1 exit status

Reproduced on several Gentoo machines. The environment looks clean. It
compiles just fine on any commit before
400eaa3452e9380ec77ac62266530055506ea6e7.

Thanks,
Christian

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-06-03  2:48     ` Christian Stewart
@ 2017-06-03 10:54       ` Waldemar Brodkorb
  2017-12-19 23:26         ` Christian Stewart
  2017-12-23  7:25         ` Christian Stewart
  0 siblings, 2 replies; 24+ messages in thread
From: Waldemar Brodkorb @ 2017-06-03 10:54 UTC (permalink / raw)
  To: buildroot

Hi,

can you make the last failing link command more verbose?
CCLD should be expanded to the full command used.

best regards
 Waldemar 

> Am 03.06.2017 um 04:48 schrieb Christian Stewart <christian@paral.in>:
> 
> Hi all,
> 
>> On Thu, Jun 1, 2017 at 4:35 PM, Christian Stewart <christian@paral.in> wrote:
>> /home/hristian/jpl_skiff/skiff/buildroot-work/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
>> error: /lib/libpam.so: incompatible target
>> /home/hristian/jpl_skiff/skiff/buildroot-work/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
>> error: /lib/libpam_misc.so: incompatible target
>> collect2: error: ld returned 1 exit status
>> make[3]: *** [Makefile:12503: systemd-analyze] Error 1
>> make[3]: *** Waiting for unfinished jobs....
>> /home/hristian/jpl_skiff/skiff/buildroot-work/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
>> error: /lib/libpam.so: incompatible target
>> /home/hristian/jpl_skiff/skiff/buildroot-work/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/6.3.1/../../../../arm-linux-gnueabihf/bin/ld.gold:
>> error: /lib/libpam_misc.so: incompatible target
>> collect2: error: ld returned 1 exit status
> 
> Reproduced on several Gentoo machines. The environment looks clean. It
> compiles just fine on any commit before
> 400eaa3452e9380ec77ac62266530055506ea6e7.
> 
> Thanks,
> Christian
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-06-03 10:54       ` Waldemar Brodkorb
@ 2017-12-19 23:26         ` Christian Stewart
  2017-12-20  0:31           ` Christian Stewart
  2017-12-23  7:25         ` Christian Stewart
  1 sibling, 1 reply; 24+ messages in thread
From: Christian Stewart @ 2017-12-19 23:26 UTC (permalink / raw)
  To: buildroot

Hi Waldemar, all,

Waldemar Brodkorb <wbx@openadk.org> writes:
> can you make the last failing link command more verbose?
> CCLD should be expanded to the full command used.

I'm still seeing this error under Gentoo against 2017.11:

>>> systemd 234 Building

PATH="/buildroot/host/bin:/buildroot/host/sbin:/usr/x86_64-pc-linux-gnu/gcc-bin/6.4.0:/usr/local/bin:/usr/bin:/bin:/opt/bin:/opt/golang/bin  /usr/bin/make -j5  -C /buildroot/build/systemd-234/     
Making all in .
  CCLD     libnss_systemd.la
  CCLD     libnss_myhostname.la
  CCLD     systemd-cgtop
  CCLD     systemd-cgls
  CCLD     systemd-nspawn
  CCLD     systemd-detect-virt
  CCLD     systemd-delta
  CCLD     systemd-analyze
  CCLD     systemd-run
  CCLD     systemd-mount
  CCLD     systemd-stdio-bridge
  CCLD     systemd-path
  CCLD     busctl
  CCLD     systemd-socket-activate
/lib/libpam.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status

I believe on Gentoo some sort of environment leakage is breaking the lib path.

defconfig:

BR2_arm=y
BR2_cortex_a9=y
BR2_ARM_ENABLE_NEON=y
BR2_ARM_ENABLE_VFP=y
BR2_ARM_INSTRUCTIONS_THUMB2=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_INIT_SYSTEMD=y


This has been an issue for quite some time, and the reason why I have
not upgraded past the early 2017 release. I finally upgraded to 2017.11
and have found that it's once again broken compilations on my machine.

I'm not sure how to get Buildroot to produce a more verbose CCLD output,
I have tried "make VERBOSE=1" but this doesn't give me more than shown above.

I previously bisected the issue down to commit 400eaa3452 if that helps.

That commit bumped the linux headers (I believe) from 4.9.9 to 4.10.0.

Best,
Christian Stewart

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-12-19 23:26         ` Christian Stewart
@ 2017-12-20  0:31           ` Christian Stewart
  0 siblings, 0 replies; 24+ messages in thread
From: Christian Stewart @ 2017-12-20  0:31 UTC (permalink / raw)
  To: buildroot


Hi all,

Christian Stewart <christian@paral.in> writes:
> I'm still seeing this error under Gentoo against 2017.11:
>   CCLD     busctl
>   CCLD     systemd-socket-activate
> /lib/libpam.so: file not recognized: File format not recognized
> collect2: error: ld returned 1 exit status
>
> defconfig:

I have found that the defconfig I sent in my previous email does not
reproduce the issue. The issue can successfully be reproduced against
2017.11 with the following defconfig:

BR2_arm=y
BR2_cortex_a7=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_CCACHE=y
BR2_OPTIMIZE_2=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
BR2_BINUTILS_VERSION_2_27_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_GCC_ENABLE_LTO=y
BR2_INIT_SYSTEMD=y
BR2_SYSTEM_BIN_SH_BASH=y
BR2_ENABLE_LOCALE_WHITELIST="C en_US en_US.UTF-8"
BR2_GENERATE_LOCALE="en_US.UTF-8"
BR2_PACKAGE_BUSYBOX_SELINUX=y

I'm not sure what it is in this set of config options that causes the problem.

Best,
Christian Stewart

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-06-03 10:54       ` Waldemar Brodkorb
  2017-12-19 23:26         ` Christian Stewart
@ 2017-12-23  7:25         ` Christian Stewart
  2017-12-23 10:06           ` Waldemar Brodkorb
  1 sibling, 1 reply; 24+ messages in thread
From: Christian Stewart @ 2017-12-23  7:25 UTC (permalink / raw)
  To: buildroot


Hi Waldemar, all,

Waldemar Brodkorb <wbx@openadk.org> writes:
> can you make the last failing link command more verbose?
> CCLD should be expanded to the full command used.

I went back and figured out how to make autotools verbose in Buildroot,
so here you are. Note that I am using out-of-tree build mode, like this:

  make -O$(pwd) -C path/to/buildroot

/bin/sh ./libtool  --tag=CC   --mode=link /home/paralin/buildroot/host/bin/arm-buildroot-linux-gnueabihf-gcc -D__SANE_USERSPACE_TYPES__  -pipe -Wall -Wextra -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Werror=shadow -flto -ffunction-sections -fdata-sections   -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O2  -fno-lto -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -pie    -o busctl src/busctl/busctl.o src/busctl/busctl-introspect.o libsystemd-shared.la                           
libtool: link: /home/paralin/buildroot/host/bin/arm-buildroot-linux-gnueabihf-gcc -D__SANE_USERSPACE_TYPES__ -pipe -Wall -Wextra -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Werror=shadow -flto -ffunction-sections -fdata-sections -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -fno-lto -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -Wl,-z -Wl,relro -Wl,-z -Wl,now -pie -o systemd-mount src/mount/mount-tool.o  ./.libs/libsystemd-shared.so -L/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -lcap -lrt -lresolv /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/liblzma.so -llz4 /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgcrypt.so /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgpg-error.so /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libblkid.so /home/paralin/buildroot/build/util-linux-2.31/.libs/libuuid.so -pthread -Wl,-rpath -Wl,/home/paralin/buildroot/build/systemd-234/.libs -Wl,-rpath -Wl,/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -Wl,-rpath -Wl,/home/paralin/buildroot/build/util-linux-2.31/.libs -Wl,-rpath -Wl,/lib/systemd -Wl,-rpath -Wl,/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib                                                                                                                                                                                             
libtool: link: /home/paralin/buildroot/host/bin/arm-buildroot-linux-gnueabihf-gcc -D__SANE_USERSPACE_TYPES__ -pipe -Wall -Wextra -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Werror=shadow -flto -ffunction-sections -fdata-sections -I/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/libmount -I/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/blkid -I/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/uuid -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -fno-lto -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -Wl,-z -Wl,relro -Wl,-z -Wl,now -pie -o systemd-analyze src/analyze/systemd_analyze-analyze.o src/analyze/systemd_analyze-analyze-verify.o  ./.libs/libcore.a /home/paralin/buildroot/build/systemd-234/.libs/libsystemd-shared.so -L/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -lcap -lresolv -llz4 /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgcrypt.so /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgpg-error.so /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libblkid.so /lib/libpam.so /lib/libpam_misc.so /home/paralin/buildroot/build/linux-pam-1.3.0/libpam/.libs/libpam.so -ldl /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libkmod.so /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/liblzma.so -lz /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libmount.so /home/paralin/buildroot/build/util-linux-2.31/.libs/libblkid.so /home/paralin/buildroot/build/util-linux-2.31/.libs/libuuid.so -lrt -pthread -Wl,-rpath -Wl,/home/paralin/buildroot/build/systemd-234/.libs -Wl,-rpath -Wl,/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -Wl,-rpath -Wl,/home/paralin/buildroot/build/linux-pam-1.3.0/libpam/.libs -Wl,-rpath -Wl,/home/paralin/buildroot/build/util-linux-2.31/.libs -Wl,-rpath -Wl,/lib/systemd -Wl,-rpath -Wl,/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib                                                                                                                                                                                          
/lib/libpam.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:12785: systemd-analyze] Error 1
make[4]: *** Waiting for unfinished jobs....
libtool: link: /home/paralin/buildroot/host/bin/arm-buildroot-linux-gnueabihf-gcc -D__SANE_USERSPACE_TYPES__ -pipe -Wall -Wextra -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style

It appears to be explicitly linking against absolute path /lib/libpam.so
on my machine. My environment is clean, no LD_PATH modifications or so.

Any help is greatly appreciated. I cannot use the newer versions of
Buildroot because of this.

Thanks,
Christian

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-12-23  7:25         ` Christian Stewart
@ 2017-12-23 10:06           ` Waldemar Brodkorb
  2017-12-23 20:36             ` Christian Stewart
  0 siblings, 1 reply; 24+ messages in thread
From: Waldemar Brodkorb @ 2017-12-23 10:06 UTC (permalink / raw)
  To: buildroot

Hi,

check config.log where pam_misc is added. May be configure has a bug and detects your host pam under certain conditions.

best regards
 Waldemar 

> Am 23.12.2017 um 08:25 schrieb Christian Stewart <christian@paral.in>:
> 
> 
> Hi Waldemar, all,
> 
> Waldemar Brodkorb <wbx@openadk.org> writes:
>> can you make the last failing link command more verbose?
>> CCLD should be expanded to the full command used.
> 
> I went back and figured out how to make autotools verbose in Buildroot,
> so here you are. Note that I am using out-of-tree build mode, like this:
> 
>  make -O$(pwd) -C path/to/buildroot
> 
> /bin/sh ./libtool  --tag=CC   --mode=link /home/paralin/buildroot/host/bin/arm-buildroot-linux-gnueabihf-gcc -D__SANE_USERSPACE_TYPES__  -pipe -Wall -Wextra -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Werror=shadow -flto -ffunction-sections -fdata-sections   -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O2  -fno-lto -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -pie    -o busctl src/busctl/busctl.o src/busctl/busctl-introspect.o libsystemd-shared.la                           
> libtool: link: /home/paralin/buildroot/host/bin/arm-buildroot-linux-gnueabihf-gcc -D__SANE_USERSPACE_TYPES__ -pipe -Wall -Wextra -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Werror=shadow -flto -ffunction-sections -fdata-sections -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -fno-lto -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -Wl,-z -Wl,relro -Wl,-z -Wl,now -pie -o systemd-mount src/mount/mount-tool.o  ./.libs/libsystemd-shared.so -L/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -lcap -lrt -lresolv /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/liblzma.so -llz4 /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgcrypt.so /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgpg-error.so /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libblkid.so /home/paralin/buildroot/build/util-linux-2.31/.libs/libuuid.so -pthread -Wl,-rpath -Wl,/home/paralin/buildroot/build/systemd-234/.libs -Wl,-rpath -Wl,/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -Wl,-rpath -Wl,/home/paralin/buildroot/build/util-linux-2.31/.libs -Wl,-rpath -Wl,/lib/systemd -Wl,-rpath -Wl,/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib                                                                                                                                                                                             
> libtool: link: /home/paralin/buildroot/host/bin/arm-buildroot-linux-gnueabihf-gcc -D__SANE_USERSPACE_TYPES__ -pipe -Wall -Wextra -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Werror=shadow -flto -ffunction-sections -fdata-sections -I/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/libmount -I/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/blkid -I/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/uuid -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -fno-lto -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -Wl,-z -Wl,relro -Wl,-z -Wl,now -pie -o systemd-analyze src/analyze/systemd_analyze-analyze.o src/analyze/systemd_analyze-analyze-verify.o  ./.libs/libcore.a /home/paralin/buildroot/build/systemd-234/.libs/libsystemd-shared.so -L/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -lcap -lresolv -llz4 /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgcrypt.so /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgpg-error.so /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libblkid.so /lib/libpam.so /lib/libpam_misc.so /home/paralin/buildroot/build/linux-pam-1.3.0/libpam/.libs/libpam.so -ldl /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libkmod.so /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/liblzma.so -lz /home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libmount.so /home/paralin/buildroot/build/util-linux-2.31/.libs/libblkid.so /home/paralin/buildroot/build/util-linux-2.31/.libs/libuuid.so -lrt -pthread -Wl,-rpath -Wl,/home/paralin/buildroot/build/systemd-234/.libs -Wl,-rpath -Wl,/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -Wl,-rpath -Wl,/home/paralin/buildroot/build/linux-pam-1.3.0/libpam/.libs -Wl,-rpath -Wl,/home/paralin/buildroot/build/util-linux-2.31/.libs -Wl,-rpath -Wl,/lib/systemd -Wl,-rpath -Wl,/home/paralin/buildroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib                                                                                                                                                                                          
> /lib/libpam.so: file not recognized: File format not recognized
> collect2: error: ld returned 1 exit status
> make[4]: *** [Makefile:12785: systemd-analyze] Error 1
> make[4]: *** Waiting for unfinished jobs....
> libtool: link: /home/paralin/buildroot/host/bin/arm-buildroot-linux-gnueabihf-gcc -D__SANE_USERSPACE_TYPES__ -pipe -Wall -Wextra -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style
> 
> It appears to be explicitly linking against absolute path /lib/libpam.so
> on my machine. My environment is clean, no LD_PATH modifications or so.
> 
> Any help is greatly appreciated. I cannot use the newer versions of
> Buildroot because of this.
> 
> Thanks,
> Christian
> 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-12-23 10:06           ` Waldemar Brodkorb
@ 2017-12-23 20:36             ` Christian Stewart
  2017-12-24 10:38               ` Waldemar Brodkorb
  2017-12-24 12:09               ` Waldemar Brodkorb
  0 siblings, 2 replies; 24+ messages in thread
From: Christian Stewart @ 2017-12-23 20:36 UTC (permalink / raw)
  To: buildroot

Hi Waldemar,

Thank you for looking into this-

Waldemar Brodkorb <wbx@openadk.org> writes:
> check config.log where pam_misc is added. May be configure has a bug and detects your host pam under certain conditions.

Seems like it.

> PAM_LIBS='-lpam -lpam_misc'

Here is the full log:

https://gist.githubusercontent.com/paralin/94cd4b80efcce6b419e337eccd534fb9/raw/59a9df0c09bc0ebd9968c7992aa8f608a4bc75ce/systemd-config.log

Thanks,
Christian

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-12-23 20:36             ` Christian Stewart
@ 2017-12-24 10:38               ` Waldemar Brodkorb
  2017-12-24 12:09               ` Waldemar Brodkorb
  1 sibling, 0 replies; 24+ messages in thread
From: Waldemar Brodkorb @ 2017-12-24 10:38 UTC (permalink / raw)
  To: buildroot

Hi,
Christian Stewart wrote,

> Hi Waldemar,
> 
> Thank you for looking into this-
> 
> Waldemar Brodkorb <wbx@openadk.org> writes:
> > check config.log where pam_misc is added. May be configure has a bug and detects your host pam under certain conditions.
> 
> Seems like it.
> 
> > PAM_LIBS='-lpam -lpam_misc'
> 

Is there a copy of libpam_misc.so somewhere in your buildroot
directory?

best regards
 Waldemar

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-12-23 20:36             ` Christian Stewart
  2017-12-24 10:38               ` Waldemar Brodkorb
@ 2017-12-24 12:09               ` Waldemar Brodkorb
  2017-12-25  1:35                 ` Christian Stewart
  1 sibling, 1 reply; 24+ messages in thread
From: Waldemar Brodkorb @ 2017-12-24 12:09 UTC (permalink / raw)
  To: buildroot

Hi,
Christian Stewart wrote,

> Hi Waldemar,
> 
> Thank you for looking into this-
> 
> Waldemar Brodkorb <wbx@openadk.org> writes:
> > check config.log where pam_misc is added. May be configure has a bug and detects your host pam under certain conditions.
> 
> Seems like it.
> 
> > PAM_LIBS='-lpam -lpam_misc'
> 

I cannot reproduce the problem with your defconfig and br git
master.
I disabled ccache. Could you try without ccache?
Isn't --disable-pam used when you did not enable linux-pam?

best regards
 Waldemar

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-12-24 12:09               ` Waldemar Brodkorb
@ 2017-12-25  1:35                 ` Christian Stewart
  2017-12-25 15:13                   ` Waldemar Brodkorb
  0 siblings, 1 reply; 24+ messages in thread
From: Christian Stewart @ 2017-12-25  1:35 UTC (permalink / raw)
  To: buildroot

Hi Waldemar,

There are no extra pam files in my Buildroot tree - before building I
ensure this with a "git clean -xfd" and I've searched the tree as well.

Waldemar Brodkorb <wbx@openadk.org> writes:
> I cannot reproduce the problem with your defconfig and br git
> master.

It may be something specific to Gentoo? The environment looks clean, so
I don't know how Gentoo would affect it, but there's one difference.

BR2_COMPILER_PARANOID_UNSAFE_PATH is enabled, shouldn't this catch it?

Note, I'm using an external build - 

 $ cd buildroot-src/
 $ make O=/home/paralin/buildroot defconfig
 $ cd /home/paralin/buildroot
 $ make clean
 $ make defconfig BR2_DEFCONFIG=$(pwd)/defconfig
 $ make all

> I disabled ccache. Could you try without ccache?

With ccache disabled:

libtool: link: /home/paralin/builroot/host/bin/arm-buildroot-linux-gnueabihf-gcc -D__SANE_USERSPACE_TYPES__ -pipe -Wall -Wextra -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Werror=shadow -flto -ffunction-sections -fdata-sections -I/home/paralin/builroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/libmount -I/home/paralin/builroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/blkid -I/home/paralin/builroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/uuid -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -fno-lto -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -Wl,-z -Wl,relro -Wl,-z -Wl,now -pie -o systemd-analyze src/analyze/systemd_analyze-analyze.o src/analyze/systemd_analyze-analyze-verify.o  ./.libs/libcore.a /home/paralin/builroot/build/systemd-234/.libs/libsystemd-shared.so -L/home/paralin/builroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -lcap -lresolv -llz4 /home/paralin/builroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgcrypt.so /home/paralin/builroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgpg-error.so /home/paralin/builroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libblkid.so /lib/libpam.so /lib/libpam_misc.so /home/paralin/builroot/build/linux-pam-1.3.0/libpam/.libs/libpam.so -ldl /home/paralin/builroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libkmod.so /home/paralin/builroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/liblzma.so -lz /home/paralin/builroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libmount.so /home/paralin/builroot/build/util-linux-2.31/.libs/libblkid.so /home/paralin/builroot/build/util-linux-2.31/.libs/libuuid.so -lrt -pthread -Wl,-rpath -Wl,/home/paralin/builroot/build/systemd-234/.libs -Wl,-rpath -Wl,/home/paralin/builroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -Wl,-rpath -Wl,/home/paralin/builroot/build/linux-pam-1.3.0/libpam/.libs -Wl,-rpath -Wl,/home/paralin/builroot/build/util-linux-2.31/.libs -Wl,-rpath -Wl,/lib/systemd -Wl,-rpath -Wl,/home/paralin/builroot/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib
/lib/libpam.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status

> Isn't --disable-pam used when you did not enable linux-pam?

linux-pam is selected by:

 BR2_PACKAGE_UTIL_LINUX_{LOGIN, RUNUSER, SU}

Which I have enabled- here is a full defconfig:

  BR2_cortex_a7=y
  BR2_ARM_FPU_NEON_VFPV4=y
  BR2_CCACHE=y
  BR2_OPTIMIZE_2=y
  BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
  BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
  BR2_BINUTILS_VERSION_2_27_X=y
  BR2_TOOLCHAIN_BUILDROOT_CXX=y
  BR2_GCC_ENABLE_LTO=y
  BR2_TARGET_GENERIC_PASSWD_SHA256=y
  BR2_INIT_SYSTEMD=y
  BR2_SYSTEM_BIN_SH_BASH=y
  BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
  BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y
  BR2_ENABLE_LOCALE_WHITELIST="C en_US en_US.UTF-8"
  BR2_GENERATE_LOCALE="en_US.UTF-8"
  BR2_LINUX_KERNEL=y
  BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
  BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/archive/a5de96867a1d9a5087129ac61608446919a922ac/linux-rpi-4.9.70-a5de96.tar.gz"
  BR2_LINUX_KERNEL_DEFCONFIG="bcm2709"
  BR2_LINUX_KERNEL_DTS_SUPPORT=y
  BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2710-rpi-3-b"
  BR2_PACKAGE_BZIP2=y
  BR2_PACKAGE_GZIP=y
  BR2_PACKAGE_LZ4=y
  BR2_PACKAGE_UNZIP=y
  BR2_PACKAGE_XZ=y
  BR2_PACKAGE_ZIP=y
  BR2_PACKAGE_LSOF=y
  BR2_PACKAGE_BINUTILS=y
  BR2_PACKAGE_GREP=y
  BR2_PACKAGE_E2FSPROGS=y
  BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y
  BR2_PACKAGE_MMC_UTILS=y
  BR2_PACKAGE_RPI_FIRMWARE=y
  BR2_PACKAGE_RTL8192CU=y
  BR2_PACKAGE_USBUTILS=y
  BR2_PACKAGE_LIBZIP=y
  BR2_PACKAGE_LZO=y
  BR2_PACKAGE_CA_CERTIFICATES=y
  BR2_PACKAGE_LIBSSH=y
  BR2_PACKAGE_LIBSSH2=y
  BR2_PACKAGE_LIBCURL=y
  BR2_PACKAGE_CURL=y
  BR2_PACKAGE_LIBSEPOL=y
  BR2_PACKAGE_ETHTOOL=y
  BR2_PACKAGE_IPUTILS=y
  BR2_PACKAGE_IW=y
  BR2_PACKAGE_MOSH=y
  BR2_PACKAGE_NETWORK_MANAGER=y
  BR2_PACKAGE_NTP=y
  BR2_PACKAGE_NTP_NTPDATE=y
  BR2_PACKAGE_NTP_NTPDC=y
  BR2_PACKAGE_NTP_NTPQ=y
  BR2_PACKAGE_RSYNC=y
  BR2_PACKAGE_WGET=y
  BR2_PACKAGE_WPA_SUPPLICANT=y
  BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y
  BR2_PACKAGE_WPA_SUPPLICANT_EAP=y
  BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT=y
  BR2_PACKAGE_WPA_SUPPLICANT_WPS=y
  BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
  BR2_PACKAGE_WPA_SUPPLICANT_WPA_CLIENT_SO=y
  BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
  BR2_PACKAGE_WPA_SUPPLICANT_DBUS_NEW=y
  BR2_PACKAGE_FILE=y
  BR2_PACKAGE_COREUTILS=y
  # BR2_PACKAGE_SYSTEMD_NETWORKD is not set
  # BR2_PACKAGE_SYSTEMD_RESOLVED is not set
  # BR2_PACKAGE_SYSTEMD_TIMEDATED is not set
  # BR2_PACKAGE_SYSTEMD_TIMESYNCD is not set
  BR2_PACKAGE_UTIL_LINUX_FALLOCATE=y
  BR2_PACKAGE_UTIL_LINUX_KILL=y
  BR2_PACKAGE_UTIL_LINUX_LINE=y
  BR2_PACKAGE_UTIL_LINUX_LOGIN=y
  BR2_PACKAGE_UTIL_LINUX_MORE=y
  BR2_PACKAGE_UTIL_LINUX_NEWGRP=y
  BR2_PACKAGE_UTIL_LINUX_RFKILL=y
  BR2_PACKAGE_UTIL_LINUX_SETPRIV=y
  BR2_PACKAGE_UTIL_LINUX_SU=y
  BR2_PACKAGE_NANO=y
  BR2_PACKAGE_VIM=y
  # BR2_PACKAGE_VIM_RUNTIME is not set
  BR2_TARGET_ROOTFS_CPIO=y
  BR2_TARGET_ROOTFS_CPIO_GZIP=y
  BR2_TARGET_ROOTFS_CPIO_UIMAGE=y
  # BR2_TARGET_ROOTFS_TAR is not set
  BR2_PACKAGE_HOST_DOSFSTOOLS=y
  BR2_PACKAGE_HOST_E2FSPROGS=y
  BR2_PACKAGE_HOST_GENEXT2FS=y
  BR2_PACKAGE_HOST_GENIMAGE=y
  BR2_PACKAGE_HOST_PARTED=y
  BR2_PACKAGE_HOST_SQUASHFS=y

... so PAM is enabled on the system. I can try building with it disabled
as well, but that would most likely fix it. I need PAM though.

Thanks!
Christian 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-12-25  1:35                 ` Christian Stewart
@ 2017-12-25 15:13                   ` Waldemar Brodkorb
  2017-12-26 21:50                     ` Christian Stewart
  0 siblings, 1 reply; 24+ messages in thread
From: Waldemar Brodkorb @ 2017-12-25 15:13 UTC (permalink / raw)
  To: buildroot

Hi,
Christian Stewart wrote,

> Hi Waldemar,
> 
> There are no extra pam files in my Buildroot tree - before building I
> ensure this with a "git clean -xfd" and I've searched the tree as well.

But that is strange then.
find . -name libpam_misc.so\*
./output/build/linux-pam-1.3.0/libpam_misc/.libs/libpam_misc.so.0
./output/build/linux-pam-1.3.0/libpam_misc/.libs/libpam_misc.so
./output/build/linux-pam-1.3.0/libpam_misc/.libs/libpam_misc.so.0.82.1
./output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libpam_misc.so.0
./output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libpam_misc.so
./output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libpam_misc.so.0.82.1
./output/target/usr/lib/libpam_misc.so.0
./output/target/usr/lib/libpam_misc.so
./output/target/usr/lib/libpam_misc.so.0.82.1


Systemd wants to find libpam, if it is not there it seems to
fallback to your native libpam.

You should always run "make clean && make" if you make any
changes to your .config.

best regards
 Waldemar

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-12-25 15:13                   ` Waldemar Brodkorb
@ 2017-12-26 21:50                     ` Christian Stewart
  2017-12-27  0:55                       ` Christian Stewart
  0 siblings, 1 reply; 24+ messages in thread
From: Christian Stewart @ 2017-12-26 21:50 UTC (permalink / raw)
  To: buildroot

Hi Waldemar,

Waldemar Brodkorb <wbx@openadk.org> writes:
>> There are no extra pam files in my Buildroot tree - before building I
>> ensure this with a "git clean -xfd" and I've searched the tree as well.
>
> But that is strange then.
> find . -name libpam_misc.so\*
> ./output/build/linux-pam-1.3.0/libpam_misc/.libs/libpam_misc.so.0
> ./output/build/linux-pam-1.3.0/libpam_misc/.libs/libpam_misc.so
> ./output/build/linux-pam-1.3.0/libpam_misc/.libs/libpam_misc.so.0.82.1

... please note that I am building out of tree. There are no
limpam_misc* inside the "buildroot tree" which includes the main source
tree. When the compilation fails, inside my "output tree":

  $ find -name "libpam_misc.so*"
  ./build/linux-pam-1.3.0/libpam_misc/.libs/libpam_misc.so
  ./build/linux-pam-1.3.0/libpam_misc/.libs/libpam_misc.so.0
  ./build/linux-pam-1.3.0/libpam_misc/.libs/libpam_misc.so.0.82.1
  ./target/usr/lib/libpam_misc.so
  ./target/usr/lib/libpam_misc.so.0
  ./target/usr/lib/libpam_misc.so.0.82.1
  ./host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libpam_misc.so
  ./host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libpam_misc.so.0
  ./host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libpam_misc.so.0.82.1

> Systemd wants to find libpam, if it is not there it seems to
> fallback to your native libpam.

Clearly, then, it is not finding the "./target/usr/lib/libpam_misc.so"
in "out-of-tree" build.

> You should always run "make clean && make" if you make any
> changes to your .config.

...I do...

Best,
Christian

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-12-26 21:50                     ` Christian Stewart
@ 2017-12-27  0:55                       ` Christian Stewart
  2017-12-27  3:05                         ` Waldemar Brodkorb
  0 siblings, 1 reply; 24+ messages in thread
From: Christian Stewart @ 2017-12-27  0:55 UTC (permalink / raw)
  To: buildroot

Hi Waldemar, All,

Christian Stewart <christian@paral.in> writes:
> Hi Waldemar,
>
> Waldemar Brodkorb <wbx@openadk.org> writes:
>>> There are no extra pam files in my Buildroot tree - before building I
>>> ensure this with a "git clean -xfd" and I've searched the tree as well.
>>
>> But that is strange then.
>> find . -name libpam_misc.so\*
>> ./output/build/linux-pam-1.3.0/libpam_misc/.libs/libpam_misc.so.0
>> ./output/build/linux-pam-1.3.0/libpam_misc/.libs/libpam_misc.so
>> ./output/build/linux-pam-1.3.0/libpam_misc/.libs/libpam_misc.so.0.82.1
>
> ... please note that I am building out of tree. There are no
> limpam_misc* inside the "buildroot tree" which includes the main source
> tree. When the compilation fails, inside my "output tree":

I can confirm now that even in-tree builds result in the same thing:

libtool: link: /home/paralin/Documents/buildroot/output/host/bin/arm-buildroot-linux-gnueabihf-gcc -D__SANE_USERSPACE_TYPES__ -pipe -Wall -Wextra -Wundef -Wlogical-op -Wmissing-include-dirs -Wold-sty
le-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Wer
ror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -Wno-m
issing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-
protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Werror=shadow -flto -ffunction-sections -fdata-sections -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -fno-lto -Wl,--gc-se
ctions -Wl,--as-needed -Wl,--no-undefined -Wl,-z -Wl,relro -Wl,-z -Wl,now -pie -o systemd-run src/run/run.o  ./.libs/libsystemd-shared.so -L/home/paralin/Documents/buildroot/output/host/arm-buildroot
-linux-gnueabihf/sysroot/usr/lib -lcap -lrt -lresolv /home/paralin/Documents/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/liblzma.so -llz4 /home/paralin/Documents
/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgcrypt.so /home/paralin/Documents/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgpg-error.so /home/par
alin/Documents/synrobo/skiff/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libblkid.so /home/paralin/Documents/buildroot/output/build/util-linux-2.31/.libs/libuuid.so -pthread -
Wl,-rpath -Wl,/home/paralin/Documents/buildroot/output/build/systemd-234/.libs -Wl,-rpath -Wl,/home/paralin/Documents/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib
 -Wl,-rpath -Wl,/home/paralin/Documents/buildroot/output/build/util-linux-2.31/.libs -Wl,-rpath -Wl,/lib/systemd -Wl,-rpath -Wl,/home/paralin/Documents/buildroot/output/host/arm-buildro
ot-linux-gnueabihf/sysroot/usr/lib                                                                                                                                                                                  
/lib/libpam.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status

It must be something with how libpam is discovered that is only
triggered when on a system with a libpam.so layout like Gentoo's.

Any ideas how to go about fixing this?

Best,
Christian

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-12-27  0:55                       ` Christian Stewart
@ 2017-12-27  3:05                         ` Waldemar Brodkorb
  2017-12-27  5:39                           ` Christian Stewart
  0 siblings, 1 reply; 24+ messages in thread
From: Waldemar Brodkorb @ 2017-12-27  3:05 UTC (permalink / raw)
  To: buildroot

Hi Christian,
Christian Stewart wrote,

> Hi Waldemar, All,
> 
> Christian Stewart <christian@paral.in> writes:
> > Hi Waldemar,
> >
> > Waldemar Brodkorb <wbx@openadk.org> writes:
> >>> There are no extra pam files in my Buildroot tree - before building I
> >>> ensure this with a "git clean -xfd" and I've searched the tree as well.
> >>
> >> But that is strange then.
> >> find . -name libpam_misc.so\*
> >> ./output/build/linux-pam-1.3.0/libpam_misc/.libs/libpam_misc.so.0
> >> ./output/build/linux-pam-1.3.0/libpam_misc/.libs/libpam_misc.so
> >> ./output/build/linux-pam-1.3.0/libpam_misc/.libs/libpam_misc.so.0.82.1
> >
> > ... please note that I am building out of tree. There are no
> > limpam_misc* inside the "buildroot tree" which includes the main source
> > tree. When the compilation fails, inside my "output tree":
> 
> I can confirm now that even in-tree builds result in the same thing:

..

I believe it is an issue how gcc is calling the linker.
In my case I see following:
libsystemd-shared.la -lpam -lpam_misc
-L/home/wbx/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib
-lkmod

So the linker does not get -L before -lpam -lpam_misc pointing to
the sysroot. 

If you start gcc with verbose linker output you see:
./output/host/bin/arm-buildroot-linux-gnueabihf-gcc -Wl,-verbose

The included linker script has:
SEARCH_DIR("=/home/wbx/buildroot/output/host/arm-buildroot-linux-gnueabihf/lib");
SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib");
SEARCH_DIR("=/usr/lib");

In my case on Debian libpam.so is not in the search dirs, but in
ls /lib/x86_64-linux-gnu/libpam.so.0*
/lib/x86_64-linux-gnu/libpam.so.0
/lib/x86_64-linux-gnu/libpam.so.0.83.1
wbx at helium:~/buildroot$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.9 (jessie)
Release:        8.9
Codename:       jessie

In you case the linker finds libpam.so in /lib and try to use it.

To verify my analyzation you can add -L<sysrootpathofyourbr> into:
systemd/Makefile
PAM_LIBS =
-L/home/paralin/buildroot/pi3/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib
-lpam -lpam_misc

Like in KMOD_LIBS. Then just continue the build with make V=1 and
see if it succeeds.

As systemd is switching completely to meson buildsystem a
upstreamable patch is not possible.

best regards
 Waldemar

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-12-27  3:05                         ` Waldemar Brodkorb
@ 2017-12-27  5:39                           ` Christian Stewart
  2017-12-27  8:05                             ` Waldemar Brodkorb
  0 siblings, 1 reply; 24+ messages in thread
From: Christian Stewart @ 2017-12-27  5:39 UTC (permalink / raw)
  To: buildroot

Hi Waldemar,

Waldemar Brodkorb <wbx@openadk.org> writes:
> To verify my analyzation you can add -L<sysrootpathofyourbr> into:
> systemd/Makefile
> PAM_LIBS =
> -L/home/paralin/buildroot/pi3/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib
> -lpam -lpam_misc
>
> Like in KMOD_LIBS. Then just continue the build with make V=1 and
> see if it succeeds.

Did the build, after cleaning, again. After encountering the error, I modified the Makefile as you say:

PAM_LIBS = -L/home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -lpam -lpam_misc

And tried to continue the build. I got the same error. I also tried
doing a "make clean" inside the systemd build directory and deleting the
build and configure stamps to get it to re-configure after the Makefile
change, that too did not work.

Note that I am using an in-tree build here.

> As systemd is switching completely to meson buildsystem a
> upstreamable patch is not possible.

Hopefully some kind of short-term fix is possible in Buildroot or at
least a patch I can apply locally?

Here is the error in full, note how /lib/libpam.so is listed as an
absolute path:

/bin/sh ./libtool  --tag=CC   --mode=link /home/paralin/buildroot/output/host/bin/arm-buildroot-linux-gnueabihf-gcc -D__SANE_USERSPACE_TYPES__  -pipe -Wall -Wextra -Wundef -Wlogical-op
 -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration 
-Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-str
ings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-alia
sing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Werror=shadow -flto -ffunction-sections -fdata-sections    -I/home/paralin/Documents/synrobo/skiff/buildroot-wor
k/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/libmount -I/home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/blkid -I/home/paralin/D
ocuments/synrobo/skiff/buildroot-work/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/uuid   -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O2  -fno-lto -Wl,--gc-sections -Wl,--as
-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -pie    -o systemd-analyze src/analyze/systemd_analyze-analyze.o src/analyze/systemd_analyze-analyze-verify.o libcore.la                                         
libtool: link: /home/paralin/buildroot/output/host/bin/arm-buildroot-linux-gnueabihf-gcc -D__SANE_USERSPACE_TYPES__ -pipe -Wall -Wextra -Wundef -Wlogical-op -Wmissing-include-dirs -Wol
d-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations
 -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -
Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fs
tack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Werror=shadow -flto -ffunction-sections -fdata-sections -I/home/paralin/buildroot/output/host/arm-buildroot-lin
ux-gnueabihf/sysroot/usr/include/libmount -I/home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/blkid -I/home/paralin/Documents/synrobo/skiff/buildroo
t-work/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/uuid -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -fno-lto -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -Wl,-z -
Wl,relro -Wl,-z -Wl,now -pie -o systemd-analyze src/analyze/systemd_analyze-analyze.o src/analyze/systemd_analyze-analyze-verify.o  ./.libs/libcore.a /home/paralin/buildroot/output/bui
ld/systemd-234/.libs/libsystemd-shared.so -L/home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -lcap -lresolv -llz4 /home/paralin/Documents/synrobo/skiff
/buildroot-work/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgcrypt.so /home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgpg-error.so
 /home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libblkid.so /lib/libpam.so /lib/libpam_misc.so /home/paralin/buildroot/o
utput/build/linux-pam-1.3.0/libpam/.libs/libpam.so -ldl /home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libkmod.so /home/paralin/Documents/synrobo/ski
ff/buildroot-work/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/liblzma.so -lz /home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libmount.so
 /home/paralin/buildroot/output/build/util-linux-2.31/.libs/libblkid.so /home/paralin/buildroot/output/build/util-linux-2.31/.libs/libuuid.so -lrt -pthread
 -Wl,-rpath -Wl,/home/paralin/buildroot/output/build/systemd-234/.libs -Wl,-rpath -Wl,/home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sys
root/usr/lib -Wl,-rpath -Wl,/home/paralin/buildroot/output/build/linux-pam-1.3.0/libpam/.libs -Wl,-rpath -Wl,/home/paralin/buildroot/output/build/util-linu
x-2.31/.libs -Wl,-rpath -Wl,/lib/systemd -Wl,-rpath -Wl,/home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib                                              
/lib/libpam.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:12785: systemd-analyze] Error 1

Thanks,
Christian

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-12-27  5:39                           ` Christian Stewart
@ 2017-12-27  8:05                             ` Waldemar Brodkorb
       [not found]                               ` <87o9mkdlf1.fsf@paral.in>
  0 siblings, 1 reply; 24+ messages in thread
From: Waldemar Brodkorb @ 2017-12-27  8:05 UTC (permalink / raw)
  To: buildroot

Hi Christian,
Christian Stewart wrote,

> Hi Waldemar,
> 
> Waldemar Brodkorb <wbx@openadk.org> writes:
> > To verify my analyzation you can add -L<sysrootpathofyourbr> into:
> > systemd/Makefile
> > PAM_LIBS =
> > -L/home/paralin/buildroot/pi3/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib
> > -lpam -lpam_misc
> >
> > Like in KMOD_LIBS. Then just continue the build with make V=1 and
> > see if it succeeds.
> 
> Did the build, after cleaning, again. After encountering the error, I modified the Makefile as you say:
> 
> PAM_LIBS = -L/home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -lpam -lpam_misc
> 
> And tried to continue the build. I got the same error. I also tried
> doing a "make clean" inside the systemd build directory and deleting the
> build and configure stamps to get it to re-configure after the Makefile
> change, that too did not work.
> 
> Note that I am using an in-tree build here.
> 
> > As systemd is switching completely to meson buildsystem a
> > upstreamable patch is not possible.
> 
> Hopefully some kind of short-term fix is possible in Buildroot or at
> least a patch I can apply locally?
> 
> Here is the error in full, note how /lib/libpam.so is listed as an
> absolute path:
> 
> /bin/sh ./libtool  --tag=CC   --mode=link /home/paralin/buildroot/output/host/bin/arm-buildroot-linux-gnueabihf-gcc -D__SANE_USERSPACE_TYPES__  -pipe -Wall -Wextra -Wundef -Wlogical-op
>  -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration 
> -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-str
> ings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-alia
> sing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Werror=shadow -flto -ffunction-sections -fdata-sections    -I/home/paralin/Documents/synrobo/skiff/buildroot-wor
> k/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/libmount -I/home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/blkid -I/home/paralin/D
> ocuments/synrobo/skiff/buildroot-work/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/uuid   -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O2  -fno-lto -Wl,--gc-sections -Wl,--as
> -needed -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -pie    -o systemd-analyze src/analyze/systemd_analyze-analyze.o src/analyze/systemd_analyze-analyze-verify.o libcore.la                                         
> libtool: link: /home/paralin/buildroot/output/host/bin/arm-buildroot-linux-gnueabihf-gcc -D__SANE_USERSPACE_TYPES__ -pipe -Wall -Wextra -Wundef -Wlogical-op -Wmissing-include-dirs -Wol
> d-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations
>  -Werror=return-type -Werror=incompatible-pointer-types -Werror=format=2 -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -
> Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fs
> tack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Werror=shadow -flto -ffunction-sections -fdata-sections -I/home/paralin/buildroot/output/host/arm-buildroot-lin
> ux-gnueabihf/sysroot/usr/include/libmount -I/home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/blkid -I/home/paralin/Documents/synrobo/skiff/buildroo
> t-work/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include/uuid -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -fno-lto -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -Wl,-z -
> Wl,relro -Wl,-z -Wl,now -pie -o systemd-analyze src/analyze/systemd_analyze-analyze.o src/analyze/systemd_analyze-analyze-verify.o  ./.libs/libcore.a /home/paralin/buildroot/output/bui
> ld/systemd-234/.libs/libsystemd-shared.so -L/home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -lcap -lresolv -llz4 /home/paralin/Documents/synrobo/skiff
> /buildroot-work/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgcrypt.so /home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libgpg-error.so
>  /home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libblkid.so /lib/libpam.so /lib/libpam_misc.so /home/paralin/buildroot/o
> utput/build/linux-pam-1.3.0/libpam/.libs/libpam.so -ldl /home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libkmod.so /home/paralin/Documents/synrobo/ski
> ff/buildroot-work/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/liblzma.so -lz /home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/libmount.so
>  /home/paralin/buildroot/output/build/util-linux-2.31/.libs/libblkid.so /home/paralin/buildroot/output/build/util-linux-2.31/.libs/libuuid.so -lrt -pthread
>  -Wl,-rpath -Wl,/home/paralin/buildroot/output/build/systemd-234/.libs -Wl,-rpath -Wl,/home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sys
> root/usr/lib -Wl,-rpath -Wl,/home/paralin/buildroot/output/build/linux-pam-1.3.0/libpam/.libs -Wl,-rpath -Wl,/home/paralin/buildroot/output/build/util-linu
> x-2.31/.libs -Wl,-rpath -Wl,/lib/systemd -Wl,-rpath -Wl,/home/paralin/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib                                              
> /lib/libpam.so: file not recognized: File format not recognized
> collect2: error: ld returned 1 exit status
> make[3]: *** [Makefile:12785: systemd-analyze] Error 1
> 

There is a mixup of /home/paralin/buildroot and
/home/paralin/Documents... .

Can you use a clean clone and use intree until we found the problem?

Can you do rm -rf output/build/systemd* && make V=1 &>log
And sent me the log and the systemd build directory for post-mortem
analysis.

best regards
 Waldemar

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
       [not found]                               ` <87o9mkdlf1.fsf@paral.in>
@ 2017-12-28 18:04                                 ` Waldemar Brodkorb
  2017-12-29 19:54                                   ` Christian Stewart
  0 siblings, 1 reply; 24+ messages in thread
From: Waldemar Brodkorb @ 2017-12-28 18:04 UTC (permalink / raw)
  To: buildroot

Hi Christian,
Christian Stewart wrote,

> Sure. To make things less ambiguous, here is exactly what I did to produce
> these new results in this email:
> 
>  $ cd ~/Documents
>  $ git clone git://git.busybox.net/buildroot buildroot
>  $ cd buildroot && git checkout 2017.11
>  $ cp ~/Notes/buildroot-pam/defconfig ./defconfig
>  $ make defconfig BR2_DEFCONFIG=defconfig
>  $ make # build fails on systemd
>  $ rm -rf output/build/systemd*
>  $ make V=1 BR2_JOBS=1 &>systemd-fail.log
>  $ tar -cvf systemd-fail.tar.gz ./output/build/systemd*
> 
> > Can you do rm -rf output/build/systemd* && make V=1 &>log
> > And sent me the log and the systemd build directory for post-mortem
> > analysis.
> 
> Attached are defconfig and systemd-fail.log. The archive is too big, so
> I uploaded it to Google Drive, available here:
> 
> https://drive.google.com/a/aperturerobotics.com/file/d/1Sxq-5smjUFntRCe0o9zIYs6_--dxjjGA/view?usp=sharing
> 
> Thank you again for taking the time to debug this, I've had this issue
> early 2017 and have avoided upgrading Buildroot until we find a fix.

Sorry I believe you entered the world of libtool hell.

For the hardcore buildroot hackers, if you create a symlink in /lib
pointing to libpam.so / libpam_misc.so you can reproduce the issue.

By the way, I couldn't reproduce the issue with OpenADK.
Unfortunately I can't point to a specific patch. 
I always pass -Wl,-rpath-link -Wl,$(STAGING_DIR)/usr/lib in
LDFLAGS and I always remove any .la files from staging directory.

I do not patch the package provided ltmain.sh/libtool stuff like
Buildroot, but I always use libtool 2.4.6 with a small patch 
like this when autoreconfing a package:
+++ libtool-2.4.6/m4/libtool.m4
-  _LT_TAGVAR(hardcode_automatic, $1)=no
+  _LT_TAGVAR(hardcode_automatic, $1)=yes
 
So sorry, I can't help you out of the hell.

best regards
 Waldemar

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-12-28 18:04                                 ` Waldemar Brodkorb
@ 2017-12-29 19:54                                   ` Christian Stewart
  2018-02-14  2:55                                     ` Christian Stewart
  0 siblings, 1 reply; 24+ messages in thread
From: Christian Stewart @ 2017-12-29 19:54 UTC (permalink / raw)
  To: buildroot


Hi Waldemar,

Waldemar Brodkorb <wbx@openadk.org> writes:
>> Thank you again for taking the time to debug this, I've had this issue
>> early 2017 and have avoided upgrading Buildroot until we find a fix.
>
> Sorry I believe you entered the world of libtool hell.
>
> For the hardcore buildroot hackers, if you create a symlink in /lib
> pointing to libpam.so / libpam_misc.so you can reproduce the issue.

So there is a bug in libtool / Buildroot after all, when dealing with
/lib/libpam.so. I was previously able to bisect it down to a commit
upgrading the default Linux headers version, but I can't imagine this is
related.

> By the way, I couldn't reproduce the issue with OpenADK.
> Unfortunately I can't point to a specific patch. 
> I always pass -Wl,-rpath-link -Wl,$(STAGING_DIR)/usr/lib in
> LDFLAGS and I always remove any .la files from staging directory.

My libtool knowledge is lacking... Is there a work-around I can apply to
force Buildroot to use these LDFLAGS? I could edit the autotools infra I
suppose, but this seems like a real hack.

> I do not patch the package provided ltmain.sh/libtool stuff like
> Buildroot, but I always use libtool 2.4.6 with a small patch 
> like this when autoreconfing a package:
> +++ libtool-2.4.6/m4/libtool.m4
> -  _LT_TAGVAR(hardcode_automatic, $1)=no
> +  _LT_TAGVAR(hardcode_automatic, $1)=yes

If I try to change this in libtool in Buildroot:

checking whether the C compiler works... no
configure: error: in `/home/buildroot/skiff/workspaces/pi3/build/host-libtool-2.4.6':
configure: error: C compiler cannot create executables

I'm guessing I did it wrong? :)

> So sorry, I can't help you out of the hell.

Thanks for your help!

Best,
Christian

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2017-12-29 19:54                                   ` Christian Stewart
@ 2018-02-14  2:55                                     ` Christian Stewart
  2018-02-14  4:57                                       ` Waldemar Brodkorb
  0 siblings, 1 reply; 24+ messages in thread
From: Christian Stewart @ 2018-02-14  2:55 UTC (permalink / raw)
  To: buildroot

Hi Waldemar, all,


Christian Stewart <christian@paral.in> writes:
> Waldemar Brodkorb <wbx@openadk.org> writes:
>>> Thank you again for taking the time to debug this, I've had this issue
>>> early 2017 and have avoided upgrading Buildroot until we find a fix.
>>
>> Sorry I believe you entered the world of libtool hell.
>>
>> For the hardcore buildroot hackers, if you create a symlink in /lib
>> pointing to libpam.so / libpam_misc.so you can reproduce the issue.

It appears that this bug is fixed in the latest release (2018.02 rc2).

Thanks!
Christian

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] systemd: build failure against pam on arm
  2018-02-14  2:55                                     ` Christian Stewart
@ 2018-02-14  4:57                                       ` Waldemar Brodkorb
  0 siblings, 0 replies; 24+ messages in thread
From: Waldemar Brodkorb @ 2018-02-14  4:57 UTC (permalink / raw)
  To: buildroot

Hi,
Christian Stewart wrote,

> Hi Waldemar, all,
> 
> 
> Christian Stewart <christian@paral.in> writes:
> > Waldemar Brodkorb <wbx@openadk.org> writes:
> >>> Thank you again for taking the time to debug this, I've had this issue
> >>> early 2017 and have avoided upgrading Buildroot until we find a fix.
> >>
> >> Sorry I believe you entered the world of libtool hell.
> >>
> >> For the hardcore buildroot hackers, if you create a symlink in /lib
> >> pointing to libpam.so / libpam_misc.so you can reproduce the issue.
> 
> It appears that this bug is fixed in the latest release (2018.02 rc2).

Sure, a nice side effect of the switch to meson by upstream, which eliminates
libtool ;)

best regards
 Waldemar

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2018-02-14  4:57 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-01  2:29 [Buildroot] systemd: build failure against pam on arm Christian Stewart
2017-06-01 18:36 ` Christian Stewart
2017-06-01 22:03 ` Peter Korsgaard
2017-06-01 23:35   ` Christian Stewart
2017-06-03  2:48     ` Christian Stewart
2017-06-03 10:54       ` Waldemar Brodkorb
2017-12-19 23:26         ` Christian Stewart
2017-12-20  0:31           ` Christian Stewart
2017-12-23  7:25         ` Christian Stewart
2017-12-23 10:06           ` Waldemar Brodkorb
2017-12-23 20:36             ` Christian Stewart
2017-12-24 10:38               ` Waldemar Brodkorb
2017-12-24 12:09               ` Waldemar Brodkorb
2017-12-25  1:35                 ` Christian Stewart
2017-12-25 15:13                   ` Waldemar Brodkorb
2017-12-26 21:50                     ` Christian Stewart
2017-12-27  0:55                       ` Christian Stewart
2017-12-27  3:05                         ` Waldemar Brodkorb
2017-12-27  5:39                           ` Christian Stewart
2017-12-27  8:05                             ` Waldemar Brodkorb
     [not found]                               ` <87o9mkdlf1.fsf@paral.in>
2017-12-28 18:04                                 ` Waldemar Brodkorb
2017-12-29 19:54                                   ` Christian Stewart
2018-02-14  2:55                                     ` Christian Stewart
2018-02-14  4:57                                       ` Waldemar Brodkorb

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.