From: Jonathan Liu <net147@gmail.com>
To: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] cmake.bbclass: set ar/ld/nm/objcopy/objdump/ranlib/strip native paths
Date: Wed, 17 Jul 2013 20:57:51 +1000 [thread overview]
Message-ID: <51E678AF.2010001@gmail.com> (raw)
In-Reply-To: <51E6689B.8060400@gmail.com>
On 17/07/2013 7:49 PM, Jonathan Liu wrote:
> On 17/07/2013 7:13 PM, Stefan Herbrechtsmeier wrote:
>> Am 17.07.2013 10:40, schrieb Jonathan Liu:
>>> The CMAKE_{AR,LINKER,NM,OBJCOPY,OBJDUMP,RANLIB,STRIP} cmake variables
>>> are currently set to values like CMAKE_LINKER-NOTFOUND for native
>>> recipes because the host paths are not searched. This is because the
>>> CMAKE_FIND_ROOT_PATH_MODE_PROGRAM cmake variable is set to ONLY.
>>>
>>> To resolve this, explicitly set the variables using FIND_PROGRAM and
>>> pass the CMAKE_FIND_ROOT_PATH_BOTH option so the host paths are also
>>> searched.
>> Can you please debug the issue. Regarding my current check the
>> variables are set in CMakeFindBinUtils.cmake and this is included by
>> CMakeDetermineCCompiler.cmake. The later set
>> _CMAKE_TOOLCHAIN_LOCATION based on the CMAKE_C_COMPILER variable and
>> this is used as search location for the find_program calls. Can you
>> check the value of _CMAKE_TOOLCHAIN_LOCATION?
>>
> Within the context of the CMakeLists.txt file:
> CMAKE_C_COMPILER is /usr/bin/gcc.
> _CMAKE_TOOLCHAIN_LOCATION is not set to anything.
>
> If I add message(test) to
> build/tmp/sysroots/x86_64-linux/usr/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake,
> it doesn't get printed out when running cmake on CMakeLists.txt (cmake
> is build/tmp/sysroots/x86_64-linux/usr/bin/cmake).
>
> Regards,
> Jonathan
For:
find_program(CMAKE_AR NAMES
${_CMAKE_TOOLCHAIN_PREFIX}ar${_CMAKE_TOOLCHAIN_SUFFIX} HINTS
${_CMAKE_TOOLCHAIN_LOCATION})
It seems the ${_CMAKE_TOOLCHAIN_LOCATION} hint is not used when
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM is set to ONLY.
Test case (CMakeLists.txt):
cmake_minimum_required(VERSION 2.8)
set(CMAKE_FIND_ROOT_PATH /var/empty)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
FIND_PROGRAM(LD NAMES ld HINTS /usr/bin)
message(${LD})
Running cmake displays:
LD-NOTFOUND
If "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)" is commented out, it
displays /usr/bin/ld.
Regards,
Jonathan
next prev parent reply other threads:[~2013-07-17 11:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-17 8:40 [PATCH] cmake.bbclass: set ar/ld/nm/objcopy/objdump/ranlib/strip native paths Jonathan Liu
2013-07-17 9:13 ` Stefan Herbrechtsmeier
2013-07-17 9:49 ` Jonathan Liu
2013-07-17 10:57 ` Jonathan Liu [this message]
2013-07-17 12:12 ` Stefan Herbrechtsmeier
2013-07-18 0:47 ` Jonathan Liu
2013-07-18 9:46 ` Stefan Herbrechtsmeier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51E678AF.2010001@gmail.com \
--to=net147@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=stefan@herbrechtsmeier.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox