* multiarch & base dir
@ 2017-11-05 9:33 Luc Van Oostenryck
2017-11-05 9:59 ` Christopher Li
2017-11-05 18:50 ` Ramsay Jones
0 siblings, 2 replies; 5+ messages in thread
From: Luc Van Oostenryck @ 2017-11-05 9:33 UTC (permalink / raw)
To: Ramsay Jones; +Cc: linux-sparse
Hi,
Commit 85e2e2a25 "Add support for multiarch system header files"
added for GCC's multiarch directory. One of the change was :
+ /* add the multiarch include directories, if any */
+ if (multiarch_dir && *multiarch_dir) {
+ add_pre_buffer("#add_system \"/usr/include/%s\"\n", multiarch_dir);
+ add_pre_buffer("#add_system \"/usr/local/include/%s\"\n", multiarch_dir);
+ }
There, the multiarch dir is appended to /usr/include & /usr/local/include.
I'm wondering if using GCC_BASE should be used here instead.
Any thoughts?
Best regards,
-- Luc
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: multiarch & base dir
2017-11-05 9:33 multiarch & base dir Luc Van Oostenryck
@ 2017-11-05 9:59 ` Christopher Li
2017-11-05 10:08 ` Luc Van Oostenryck
2017-11-05 18:50 ` Ramsay Jones
1 sibling, 1 reply; 5+ messages in thread
From: Christopher Li @ 2017-11-05 9:59 UTC (permalink / raw)
To: Luc Van Oostenryck; +Cc: Ramsay Jones, Linux-Sparse
On Sun, Nov 5, 2017 at 5:33 PM, Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> wrote:
> Commit 85e2e2a25 "Add support for multiarch system header files"
> added for GCC's multiarch directory. One of the change was :
> + /* add the multiarch include directories, if any */
> + if (multiarch_dir && *multiarch_dir) {
> + add_pre_buffer("#add_system \"/usr/include/%s\"\n", multiarch_dir);
> + add_pre_buffer("#add_system \"/usr/local/include/%s\"\n", multiarch_dir);
> + }
>
>
> There, the multiarch dir is appended to /usr/include & /usr/local/include.
> I'm wondering if using GCC_BASE should be used here instead.
> Any thoughts?
I think the multiarch is for cross compile. I guess using GCC_BASE will not fit
the cross compile need. GCC_BASE has hard code to the current gcc that compile
sparse. Not necessary the same cross compile setting to run sparse.
I don't know, Ramsay might be able comment more on this.
Chris
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: multiarch & base dir
2017-11-05 9:59 ` Christopher Li
@ 2017-11-05 10:08 ` Luc Van Oostenryck
0 siblings, 0 replies; 5+ messages in thread
From: Luc Van Oostenryck @ 2017-11-05 10:08 UTC (permalink / raw)
To: Christopher Li; +Cc: Ramsay Jones, Linux-Sparse
On Sun, Nov 5, 2017 at 10:59 AM, Christopher Li <sparse@chrisli.org> wrote:
> On Sun, Nov 5, 2017 at 5:33 PM, Luc Van Oostenryck
> <luc.vanoostenryck@gmail.com> wrote:
>> Commit 85e2e2a25 "Add support for multiarch system header files"
>> added for GCC's multiarch directory. One of the change was :
>> + /* add the multiarch include directories, if any */
>> + if (multiarch_dir && *multiarch_dir) {
>> + add_pre_buffer("#add_system \"/usr/include/%s\"\n", multiarch_dir);
>> + add_pre_buffer("#add_system \"/usr/local/include/%s\"\n", multiarch_dir);
>> + }
>>
>>
>> There, the multiarch dir is appended to /usr/include & /usr/local/include.
>> I'm wondering if using GCC_BASE should be used here instead.
>> Any thoughts?
>
> I think the multiarch is for cross compile.
Not really. It's mainly used to support both 32 & 64-bit binaries on the same
platform (which supports it).
-- Luc
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: multiarch & base dir
2017-11-05 9:33 multiarch & base dir Luc Van Oostenryck
2017-11-05 9:59 ` Christopher Li
@ 2017-11-05 18:50 ` Ramsay Jones
2017-11-05 20:01 ` Luc Van Oostenryck
1 sibling, 1 reply; 5+ messages in thread
From: Ramsay Jones @ 2017-11-05 18:50 UTC (permalink / raw)
To: Luc Van Oostenryck; +Cc: linux-sparse
On 05/11/17 09:33, Luc Van Oostenryck wrote:
> Hi,
>
> Commit 85e2e2a25 "Add support for multiarch system header files"
> added for GCC's multiarch directory. One of the change was :
> + /* add the multiarch include directories, if any */
> + if (multiarch_dir && *multiarch_dir) {
> + add_pre_buffer("#add_system \"/usr/include/%s\"\n", multiarch_dir);
> + add_pre_buffer("#add_system \"/usr/local/include/%s\"\n", multiarch_dir);
> + }
>
>
> There, the multiarch dir is appended to /usr/include & /usr/local/include.
> I'm wondering if using GCC_BASE should be used here instead.
> Any thoughts?
My initial reaction is definitely not! Certainly not _instead_ of
/usr/include and /usr/local/include. Adding GCC_BASE, which would
look something like: '/usr/lib/gcc/x86_64-linux-gnu/5', does not
immediately strike me as a good idea, but I haven't given it much
thought. ;-)
ATB,
Ramsay Jones
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: multiarch & base dir
2017-11-05 18:50 ` Ramsay Jones
@ 2017-11-05 20:01 ` Luc Van Oostenryck
0 siblings, 0 replies; 5+ messages in thread
From: Luc Van Oostenryck @ 2017-11-05 20:01 UTC (permalink / raw)
To: Ramsay Jones; +Cc: linux-sparse
On Sun, Nov 05, 2017 at 06:50:22PM +0000, Ramsay Jones wrote:
>
>
> On 05/11/17 09:33, Luc Van Oostenryck wrote:
> > Hi,
> >
> > Commit 85e2e2a25 "Add support for multiarch system header files"
> > added for GCC's multiarch directory. One of the change was :
> > + /* add the multiarch include directories, if any */
> > + if (multiarch_dir && *multiarch_dir) {
> > + add_pre_buffer("#add_system \"/usr/include/%s\"\n", multiarch_dir);
> > + add_pre_buffer("#add_system \"/usr/local/include/%s\"\n", multiarch_dir);
> > + }
> >
> >
> > There, the multiarch dir is appended to /usr/include & /usr/local/include.
> > I'm wondering if using GCC_BASE should be used here instead.
> > Any thoughts?
>
> My initial reaction is definitely not! Certainly not _instead_ of
> /usr/include and /usr/local/include. Adding GCC_BASE, which would
> look something like: '/usr/lib/gcc/x86_64-linux-gnu/5', does not
> immediately strike me as a good idea, but I haven't given it much
> thought. ;-)
OK :)
Things is that I have no real idea what is the output of
'gcc -print-multiarch='
My guess is that it must be a subdirectory of the 'install dir'
which may be '/usr' but could as well be something like:
/opt/local/lib/gcc/x86_64-linux-gnu/6.3.0/
so using an hardcoded '/usr/include' seems wrong to me.
GCC's doc says the following about -print-multiarch:
"Print the path to OS libraries for the selected multiarch,
relative to some 'lib' subdirectory."
and both the 'some' and the 'lib' bring questions to my mind.
My main question is "how the output of -print-multiarch is related
to include directories?"
Not that all this matters much, though.
Regards,
-- Luc
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-11-05 20:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-05 9:33 multiarch & base dir Luc Van Oostenryck
2017-11-05 9:59 ` Christopher Li
2017-11-05 10:08 ` Luc Van Oostenryck
2017-11-05 18:50 ` Ramsay Jones
2017-11-05 20:01 ` Luc Van Oostenryck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox