All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylvain Raybaud <sylvain.raybaud@green-communications.fr>
To: buildroot@busybox.net
Subject: [Buildroot] using BR2 variables to find a specific header file
Date: Mon, 13 Oct 2014 19:10:13 +0200	[thread overview]
Message-ID: <543C0775.3090701@green-communications.fr> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear all

I'm trying to integrate a cmake based package wich is not very
cross-compiling friendly (MariaDB galera cluster). During normal
compile this package runs some tests in order to determine if stacks
grows downward or upward. During cross-compile these tests cannot be
run therefore the package expects -DSTACK_DIRECTION=+/-1 to be passed
to cmake. Of course you cannot do it in buildroot.

It seems to be possible to access this information in another way
since STACK_GROWS_DOWNWARD is defined in some headers. In my case they
are:

output/build/host-gcc-final-4.8.3/gcc/config/arm/arm.h
(option a)

or

output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.8.3/plugin/include/config/arm/arm.h
(option b)

or

output/host/usr/lib/gcc/arm-buildroot-linux-uclibcgnueabi/4.8.3/plugin/include/tm.h
which in turns includes config/arm/arm.h  but seems more generic
(option c)

using these files I could automatically determine the correct value
for STACK_DIRECTION (either searching them for STACK_GROWS_DOWNWARD or
calling C preprocessor on an ad-hoc source file that would include them).

The question is: how to determine inside buildroot which file to use?

I was thinking of using a combination of the following variables to
determine the position of these headers. I'll list them with the value
they have in my case. Do you think it's a good idea? Do you think it's
portable?

BR2_ARCH="arm"
BR2_GCC_VERSION=4.8.3
BR2_GCC_TARGET_MODE=arm
BR2_TOOLCHAIN=y
BR2_TOOLCHAIN_BUILDROOT=y
BR2_TOOLCHAIN_BUILDROOT_VENDOR=buildroot
BR_TOOLCHAIN_USES_UCLIBC=y
BR2_TOOLCHAIN_BUILDROOT_UCLIBC=y
BR2_ARM_EABI=y

Using these variables it seems I can find the correct file but I'm not
sure it's the correct way to do things. What do you think? Do you have
suggestions?

Cheers,

- -- 
Sylvain Raybaud
www.green-communications.fr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIbBAEBAgAGBQJUPAd1AAoJEEkkwl4JtJ9yPNUP+Pz/MHto4uVjnxLnA6eXT0aG
DA1RT5np6a3CGdtA3Yf3oVABmGTgLBwDvDDq1cyBqs6qs1y1oLV7rvbt3GpvCcOo
YcmsDNg+cdkIqQgJb/FLgFcZaiCmttlET6bFsg5ltM25W+dMCIVacDegtMxCpUrw
0RnUHOOBmvutdxfAI+QO+GKQtoukssmHehfywLmfzCEwaLpUjsLOSllqKXw5VqPM
EHIZhHl4j+cW2WbSB3ZBuO2vCFViK7tQuJ0pp15bidP4IyDutyw12wT/n2oofh76
EyRrUqPzuQfqNBI2Waslwg5ycgL2bzLAOQck5CA6khcI4HUucfCslA+V3xGNQDN4
oVUwo1Ji7ylE5PaTISWlhYZIsDAAjM8f/kQuhzueo3VDolFg89MQzfd2ifaWEuBh
HHuKMuSOuEI2aqvh74XVK5xeAoB0d27LgJq0Mw8q1ZcExF9IaH3c+ggnOWjXfLdw
TX9DaFabzaXG87P75WmTRua6JKeADkxcpqfn2sqiT2a8xzhtiehK0MtTCBeHg0AW
/Mic6UQtEC/GRgRkloHK1edtfioIHucMY+0sFlqvvbL2GpsS5eEio+hybMmBRUyI
VksZsRqlc0mH77ALMlv4ksGgLqYvVQP7RkPd9+XORoNaJgMMvdeK7n9QiEU8B5Yd
A40g/rR9voOF4Frsazs=
=ydRq
-----END PGP SIGNATURE-----

             reply	other threads:[~2014-10-13 17:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-13 17:10 Sylvain Raybaud [this message]
2014-10-13 17:30 ` [Buildroot] using BR2 variables to find a specific header file Mike Zick
2014-10-14 20:58   ` Arnout Vandecappelle
2014-10-13 19:42 ` Samuel Martin
2014-10-14 10:58   ` Sylvain Raybaud
2014-10-14 12:18     ` Samuel Martin

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=543C0775.3090701@green-communications.fr \
    --to=sylvain.raybaud@green-communications.fr \
    --cc=buildroot@busybox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.