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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c9b248a3-8df5-a76d-b472-9e65d837cf5c@kernel.org>
Date:   Thu, 13 Feb 2020 13:24:22 -0700
From:   shuah <shuah@...nel.org>
To:     Dmitry Safonov <dima@...sta.com>
Cc:     linux-kselftest@...r.kernel.org, avagin@...il.com,
        linux-kernel@...r.kernel.org,
        Dmitry Safonov <0x7f454c46@...il.com>, shuah <shuah@...nel.org>
Subject: Re: [PATCH] selftests: use LDLIBS for libraries instead of LDFLAGS

On 2/12/20 11:15 AM, shuah wrote:
> On 2/12/20 7:00 AM, Dmitry Safonov wrote:
>> While building selftests, the following errors were observed:
>>> tools/testing/selftests/timens'
>>> gcc -Wall -Werror -pthread  -lrt -ldl  timens.c  -o 
>>> tools/testing/selftests/timens/timens
>>> /usr/bin/ld: /tmp/ccGy5CST.o: in function `check_config_posix_timers':
>>> timens.c:(.text+0x65a): undefined reference to `timer_create'
>>> collect2: error: ld returned 1 exit status
>>
>> Quoting commit 870f193d48c2 ("selftests: net: use LDLIBS instead of
>> LDFLAGS"):
>>
>> 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.
>>
>> While at here, correct other selftests, not only timens ones.
>>
>> Reported-by: Shuah Khan <skhan@...nel.org>
>> Signed-off-by: Dmitry Safonov <dima@...sta.com>
>> ---
>>   tools/testing/selftests/futex/functional/Makefile | 2 +-
>>   tools/testing/selftests/net/Makefile              | 4 ++--
>>   tools/testing/selftests/rtc/Makefile              | 2 +-
>>   tools/testing/selftests/timens/Makefile           | 2 +-
>>   4 files changed, 5 insertions(+), 5 deletions(-)
>>
> 
> 
> Looks good. Thanks for fixing it quickly.
> 
> Please split these into 4 patches and send one for each test.
> 
> For timens:
> 
> Tested-by: Shuah Khan <skhan@...uxfoundation.org>
> 

In the interest of getting this fix in, I applied it to

git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git 
fixes branch.

No need to do anything.

thanks,
-- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ