[OE-core] CMake error? CMAKE_AR-NOTFOUND
Samuel Stirtzel
s.stirtzel at googlemail.com
Thu Jan 26 09:20:09 UTC 2012
2012/1/25 Khem Raj <raj.khem at gmail.com>:
> On Wed, Jan 25, 2012 at 12:31 AM, Samuel Stirtzel
> <s.stirtzel at googlemail.com> wrote:
>> 2012/1/25 Samuel Stirtzel <s.stirtzel at googlemail.com>:
>>> 2012/1/24 Richard Purdie <richard.purdie at linuxfoundation.org>:
>>>> On Tue, 2012-01-24 at 14:30 +0100, Samuel Stirtzel wrote:
>>>>> Hi,
>>>>> currently I try to build a native software that needs CMake, it is a
>>>>> required tool to cross compile another software.
>>>>> An it seems that CMAKE_AR is set to an invalid value (CMAKE_AR-NOTFOUND).
>>>>> The cmake.bbclass has no entry about this.
>>>>>
>>>>> By searching the web, the only information found was that it can be
>>>>> set to ${GCC_PATH}/dld.
>>>>> As I am usually not working with CMake where can I find the native
>>>>> "ar" or "dld" executable in OpenEmbedded?
>>>>>
>>>>> Using the archiver from my hosts /usr/bin/ar seems to be wrong since
>>>>> in cmake.bbclass "set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )"
>>>>> prohibits it.
>>>>
>>>> In the same way the class figures out OECMAKE_C_COMPILER from ${CC}, you
>>>> probably need to figure out ar from ${AR} and pass it to the cmake
>>>> configuration.
>>>>
>>>> Note I know very little about cmake so I'm of less help with that
>>>> piece ;-).
>>>
>>> After looking around in all ends of OE-core it shows up that this
>>> error is caused by binutils.inc.
>>> Finding ar would be no problem itself, but if the binary is not
>>> installed or gets deleted after building binutils-native it is
>>> impossible to locate it.
>>>
>>> In binutils.inc do_install:
>>> rm ${D}${bindir}/ar ${D}${bindir}/strings
>> Sorry I pasted the wrong line, this was for cross compiling.
>> From the do_install_virtclass-native:
>> # We only want libiberty, libbfd and libopcodes
>> rm -rf ${D}${bindir}
>>
>> but the effect is still the same..
>>>
>>> Well I still wonder why my target sysroot has ar if it gets deleted here...
>>>
>
> because its installed using post_install script.
>
>>> Anyone knows why ar is being removed in do_install?
>
> since post_install will install it as a symlink
>
Well that made me wonder too, because yesterday I thought that it
would use ${D}${bindir} instead of ${bindir}.
Ok I double checked this and it looks strange...
Everything further needs some explanation, looking up the used
variables will explain why ar is missing.
Therefore I added some quick debug stuff:
die "D = ${D}, bindir = ${bindir}"
-die 'D = /work/oe-core/tmp-eglibc/work/x86_64-linux/binutils-native-2.22-r2/image,
bindir = /work/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin'
die "Target prefix = ${TARGET_PREFIX}"
-die 'Target prefix = '
Inserted in the code this will look like the following (quotation
marks only stand there for visibility):
do_install_virtclass_native:
rm -rf ${D}${bindir}
rm -rf '/work/oe-core/tmp-eglibc/work/x86_64-linux/binutils-native-2.22-r2/image/work/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin'
do_pkg_postinst:
update-alternatives --install ${bindir}/ar ar ${TARGET_PREFIX}ar 100
update-alternatives --install
'/work/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin'/ar ar ''ar
100
This looks pretty weird.
It looks like ${bindir} should be
"/work/oe-core/tmp-eglibc/work/x86_64-linux/binutils-native-2.22-r2/binutils-2.22/build.x86_64-linux.x86_64-linux/binutils/",
where ar is located.
Any ideas what went wrong?
--
Regards
Samuel
More information about the Openembedded-core
mailing list