Hi Jiri.

2015-11-06 12:48 GMT+01:00 Jiri Svoboda <[email protected]>:

> Hi Vojta,
>
> ###
> sed -e 's:#include "../../../common.h":#include <libarch/common.h>:' -i
> "$HSCT_CACHE_DIR/include/abi/fourcc.h"
> ###
>
> I'm pretty sure there's a better way to do this.
>
Agreed. I should have named the commit a "workaround" rather than a fix.

I admit it was not the cleanest but the fastest way to get gcc and binutils
back to buildable state. There are a lot of other hacks in hstc.sh anyway
:-).


There are many headers in abi/ that suffer from the problem that they don't
> include what they use, hence a simple test:
>
> test.c:
> #include /header/
>
> whould fail to compile. I just fixed this one example I hit. It would
> certainly not do patching each and every one of them in hsct.sh. Why do you
> need to change the path? Is the relative path between the headers different
> when used in Coastline?
>
Yes. The reason is that common.h is somewhat special file. From userspace,
it is included via libarch/ where it is as a symlink.

hsct.sh copies all library headers to its own directory (to make it more
independent and also to allow for parallel builds for different platforms)
and this copy replaces symbolic links with actual files (which is okay and
it is much safer than possibly breaking the symlinks). Within this
so-called cache directory, common.h was not referenced/needed and thus was
never been copied there in the first place.

And since the name of the file is, well, common, hsct.sh does not copy it
to prevent possible name clashes [probably not an real problem but one that
could be difficult to trace].



> Then maybe we should not use the relative include path and instead include
> <[xx/]common.h> and pass -I <path-to-common> to the compiler.
>
I think common.h belongs to abi/ directory and shall be included by the
headers there as <abi/common.h>.

And maybe we can also split it into more files: it corresponds to limits.h
and inttypes.h in POSIX (maybe in C99 too).

Cheers,
- Vojta




>
> Cheers,
> Jiri
>
>
> _______________________________________________
> HelenOS-devel mailing list
> [email protected]
> http://lists.modry.cz/listinfo/helenos-devel
>
>
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel

Reply via email to