Problem building libstdc++ for the avr target

Keith Packard keithp@keithp.com
Sun Feb 7 18:23:04 GMT 2021


Vladimir V <vv.os.swe@gmail.com> writes:

> Hello,
>
> I finally managed to test building for AVR with Keith's patch and
> unistd.h removed (to enforce usage of stabs in filesystem).
>
> I identified a couple of minor build issues that are obvious from the
> attached patch, Could you please have a look? They work with AVR target
> and doesn't seem to cause regressions for x64 build.

Hrm. Removing unistd.h from an installed file might affect applications
using that file, so that doesn't seem ideal.

Picolibc has a unistd.h to define the relevant interfaces, even though
it doesn't require them. Perhaps avrlibc could do the same? Or even an
empty file that would satisfy this requirement?

> --- a/libstdc++-v3/src/c++17/fs_ops.cc
> +++ b/libstdc++-v3/src/c++17/fs_ops.cc
> @@ -1130,7 +1130,7 @@ fs::permissions(const path& p, perms prms, perm_options opts,
>  #else
>    if (nofollow && is_symlink(st))
>      ec = std::make_error_code(std::errc::not_supported);
> -  else if (posix::chmod(p.c_str(), static_cast<mode_t>(prms)))
> +  else if (posix::chmod(p.c_str(), static_cast<posix::mode_t>(prms)))
>      err = errno;
>  #endif

I'm afraid I don't understand what this piece does without studying the
underlying code a bunch. But, if it's just namespace stuff in an
internal implementation file, that seems fine to me.

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20210207/d9c6c0f9/attachment.sig>


More information about the Libstdc++ mailing list