lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170628170859.28583-1-fathi.boudra@linaro.org>
Date:   Wed, 28 Jun 2017 20:08:56 +0300
From:   Fathi Boudra <fathi.boudra@...aro.org>
To:     linux-kselftest@...r.kernel.org, Shuah Khan <shuah@...nel.org>
Cc:     linux-kernel@...r.kernel.org, John Stultz <john.stultz@...aro.org>,
        Denys Dmytriyenko <denys@...com>,
        SeongJae Park <sj38.park@...il.com>,
        Fathi Boudra <fathi.boudra@...aro.org>
Subject: [PATCH 0/3] selftests: fixes for undefined reference (LDFLAGS -> LDLIBS)

This serie fixes undefined reference errors caused by the usage of LDFLAGS
instead of LDLIBS.

The issue is GNU Make and linker specific.

The default Makefile rule looks like:

$(CC) $(CFLAGS) $(LDFLAGS) $@ $^ $(LDLIBS)

When linking is done by gcc itself, no issue, but when it needs to be passed
to proper ld, only LDLIBS follows and then ld cannot know what libs to link
with.

More detail:
https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html

LDFLAGS
Extra flags to give to compilers when they are supposed to invoke the linker,
‘ld’, such as -L. Libraries (-lfoo) should be added to the LDLIBS variable
instead.

LDLIBS
Library flags or names given to compilers when they are supposed to invoke the
linker, ‘ld’. LOADLIBES is a deprecated (but still supported) alternative to
LDLIBS. Non-library linker flags, such as -L, should go in the LDFLAGS
variable.

https://lkml.org/lkml/2010/2/10/362

tools/perf: libraries must come after objects

Link order matters.

Fathi Boudra (3):
  selftests: net: use LDLIBS instead of LDFLAGS
  selftests: seccomp: use LDLIBS instead of LDFLAGS
  selftests: timers: use LDLIBS instead of LDFLAGS

 tools/testing/selftests/net/Makefile     | 2 +-
 tools/testing/selftests/seccomp/Makefile | 4 ++--
 tools/testing/selftests/timers/Makefile  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

-- 
2.13.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ