This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: arc profiling broken (Was: [4.1 patch] relocate profile data file)


Lu, Hongjiu wrote:

Newlib can have access/mkdir, depending on targets. --with-newlib
doesn't mean access/mkdir aren't available. Since access/mkdir are OS
features, can config.gcc define TARGET_POSIX_IO, depending on the target
OS? We can assume *-elf/coff/aout don't have TARGET_POSIX_IO. We can add
more targets to it later.


Yes, we can work it all out in config.gcc. I'm not sure that makes sense, though.
We could work out every single macro in config.gcc, and do away with all
the target config header files, but we'd get a huge mess of spaghetti code.
Is there any reason why TARGET_POSIX_IO would be better set in config.gcc,
rather than the target config files?
We have config files that are generic for a number of OSes, so we don't actually
have to write significantly more code than if we put it in config.gcc. It might
actually be less, since we don't need to have new code to select on the OS and
other features.
As said before, I think replacing the definitions of TARGET_HAS_SETLKW
with definitions of TARGET_POSIX_IO provides a perfect starting point.


One thing we could do to avoid #ifndef clumps in the target files, where
we want a configure option to be able to override a target setting, is to have
a variant macro set in the target files, and then have defaults.h use that target
selection if and only if there is no overriding setting from config.gcc.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]