Bug 105719 - RFE: fixincludes should handle Frameworks
Summary: RFE: fixincludes should handle Frameworks
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 12.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-24 14:41 UTC by Eric Gallager
Modified: 2024-07-11 21:04 UTC (History)
7 users (show)

See Also:
Host:
Target: *-*-darwin
Build:
Known to work:
Known to fail:
Last reconfirmed: 2022-05-24 00:00:00


Attachments
Implement the use of fixed framework headers (1.70 KB, patch)
2023-05-14 19:43 UTC, Iain Sandoe
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Gallager 2022-05-24 14:41:53 UTC
This is split off from bug 93082. Basically, if there is a header that needs to be fixincluded in /Systems/Library/Frameworks or /Library/Frameworks or ${SDKROOT}/Library/Frameworks, fixincludes currently won't find it. This should be fixed by adding another include tree (or trees) for fixincludes to search.
Comment 1 Eric Gallager 2022-05-24 14:42:11 UTC
Mine.
Comment 2 Eric Gallager 2022-05-24 14:49:53 UTC
Related: bug 37036
Comment 3 Iain Sandoe 2022-05-24 19:21:22 UTC
(In reply to Eric Gallager from comment #0)
> This is split off from bug 93082. Basically, if there is a header that needs
> to be fixincluded in /Systems/Library/Frameworks or /Library/Frameworks or
> ${SDKROOT}/Library/Frameworks, fixincludes currently won't find it. This
> should be fixed by adding another include tree (or trees) for fixincludes to
> search.

the way that header search works, you probably want to keep the sysroot (a.k.a SDKROOT) distinct (you might want to look in gcc/config/darwin-c.cc for how the eventual search paths are constructed, just for background).

Solving 37036 would also allow us to have multiple SDKs - which would be nice since we can, in principle, target any version of Darwin with the same compiler
- the limitation preventing that is that the fixed includes (and SDK includes used in some libraries) do not work over more than a few OS revisions .. forcing us to need cross compilers for other OS versions in a rather artificial way.  If we could implement the OS version as a multilib we could avoid that and just have one compiler to target any version (or the same arch, of course).

[dreams of things we might do if time were available]
Comment 4 Iain Sandoe 2023-05-14 19:43:19 UTC
Created attachment 55084 [details]
Implement the use of fixed framework headers

this was a proof-of-principle exercise while looking into issues caused by implementing __has_feature () [PR60512].

This does not have any of the mechanism to *create* or *install* the fixed headers (for my testing I just built a CoreFoundation.framework/Headers/CFBase.h and edited bye hand to fix the problems found).

So, still plenty to do ;)
Comment 5 Bruce Korb 2023-05-15 18:10:08 UTC
It's been a long time since I mucked with fixincludes. My first guess, without going back and reading code, would be to provide fixincludes with a list of trees to traverse and not have it burned into fixincludes at all. That might even be helpful for cross compiles also. :)
Comment 6 Eric Gallager 2023-05-18 10:24:20 UTC
(In reply to Iain Sandoe from comment #4)
> Created attachment 55084 [details]
> Implement the use of fixed framework headers
> 
> this was a proof-of-principle exercise while looking into issues caused by
> implementing __has_feature () [PR60512].
> 
> This does not have any of the mechanism to *create* or *install* the fixed
> headers (for my testing I just built a
> CoreFoundation.framework/Headers/CFBase.h and edited bye hand to fix the
> problems found).
> 
> So, still plenty to do ;)

Remind me to test this patch later; I've kind of forgotten where I was with this... distracted with other stuff... (maybe I should unassign it from myself?)
Comment 7 Eric Gallager 2024-06-07 19:58:03 UTC
(In reply to Eric Gallager from comment #6)
> (In reply to Iain Sandoe from comment #4)
> > Created attachment 55084 [details]
> > Implement the use of fixed framework headers
> > 
> > this was a proof-of-principle exercise while looking into issues caused by
> > implementing __has_feature () [PR60512].
> > 
> > This does not have any of the mechanism to *create* or *install* the fixed
> > headers (for my testing I just built a
> > CoreFoundation.framework/Headers/CFBase.h and edited bye hand to fix the
> > problems found).
> > 
> > So, still plenty to do ;)
> 
> Remind me to test this patch later; I've kind of forgotten where I was with
> this... distracted with other stuff... (maybe I should unassign it from
> myself?)

Unassigning from myself due to being distracted by too many other things; maybe FX would like to take over?