Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752071AbdF1OUo (ORCPT ); Wed, 28 Jun 2017 10:20:44 -0400 Received: from resqmta-po-06v.sys.comcast.net ([96.114.154.165]:52878 "EHLO resqmta-po-06v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751469AbdF1OUi (ORCPT ); Wed, 28 Jun 2017 10:20:38 -0400 Reply-To: shuah@kernel.org Subject: Re: [PATCH 1/1] selftests: timers: use LDLIBS instead of LDFLAGS to link against libpthread To: Fathi Boudra , linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org, John Stultz , Denys Dmytriyenko , Shuah Khan References: <20170628091810.30484-1-fathi.boudra@linaro.org> From: Shuah Khan Message-ID: <238b17a6-6284-eee3-4481-85d71c09b335@kernel.org> Date: Wed, 28 Jun 2017 08:20:37 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170628091810.30484-1-fathi.boudra@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfLzatKRKGg4b7cYPBbtd3b+FjYx5EmNwJ2vs6BJWFe2h+g3OHped4oO5iNLV9wMc3OUI0FpybbJ2cHEGUuJUG4dzEYuwrTiZ+E2sjqakKXAW0qJdLmvl d/XfhSXee4KmkvRSwTH/5VzkxtJNTqNjS9T1OZmM49M1IiCXtgphz/zXqB2zo5PP6d+rCesuwuLEhirVz+grVjcS/45y9HfuYHMxW3HvtyTeaF5gq2UukwPy wTMwTcvp6mfWHGn85DnoI+lM0Ng23PYcQ+IxiVx7ZN9WeBsW02yDD0aCPLCT7pIKt5D6DAQMEaxt8y1W+cp2u8cgzpFGaGivmsco55oinTb79Hel9ISN8UgS zg0FXn4x Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1828 Lines: 44 On 06/28/2017 03:18 AM, Fathi Boudra wrote: > timers test fails to build due to undefined reference: > > aarch64-linaro-linux-gcc --sysroot=/build/tmp-rpb-glibc/sysroots/hikey > -O2 -pipe -g -feliminate-unused-debug-types -O3 -Wl,-no-as-needed -Wall > -DKTEST -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lrt -lpthread > posix_timers.c > -o /build/tmp-rpb-glibc/work/hikey-linaro-linux/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/timers/posix_timers > /tmp/cc1FTZzT.o: In function `check_timer_create': > /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/timers/posix_timers.c:157: > undefined reference to `timer_create' > /usr/src/debug/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/timers/posix_timers.c:170: > undefined reference to `timer_settime' > collect2: error: ld returned 1 exit status > > Use LDLIBS instead of LDFLAGS to properly link against libpthread and fix > this build issue. > > Signed-off-by: Denys Dmytriyenko > Signed-off-by: Fathi Boudra I can't reproduce this on linux-kselftest next on x86_64. Is this arm64 speocific problem? Please try this on linux-kselftest latest. thanks, -- Shuah > --- > tools/testing/selftests/timers/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/timers/Makefile b/tools/testing/selftests/timers/Makefile > index 5fa1d7e9a915..f48d7ca9d9b1 100644 > --- a/tools/testing/selftests/timers/Makefile > +++ b/tools/testing/selftests/timers/Makefile > @@ -1,6 +1,6 @@ > BUILD_FLAGS = -DKTEST > CFLAGS += -O3 -Wl,-no-as-needed -Wall $(BUILD_FLAGS) > -LDFLAGS += -lrt -lpthread > +LDLIBS += -lrt -lpthread > > # these are all "safe" tests that don't modify > # system time or require escalated privileges >