public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99327] New: ENOTSUP macro does not exist on djgpp crt
@ 2021-03-01 17:13 unlvsur at live dot com
  2021-03-01 17:14 ` [Bug libstdc++/99327] " unlvsur at live dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: unlvsur at live dot com @ 2021-03-01 17:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99327

            Bug ID: 99327
           Summary: ENOTSUP macro does not exist on djgpp crt
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unlvsur at live dot com
  Target Milestone: ---

libstdc++'s filesystem uses std::errc::not_supported but that does not exist on
djgpp. Bootstrap failure


What I did was just

#define ENOTSUP 42

in errno.h and bootstrap succeed
However, strerror will not work for this anymore.


There is another solution for this.

Replace all std::errc::not_supported to std::errc::invalid_argument since
EINVAL should exist on all platforms.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/99327] ENOTSUP macro does not exist on djgpp crt
  2021-03-01 17:13 [Bug c++/99327] New: ENOTSUP macro does not exist on djgpp crt unlvsur at live dot com
@ 2021-03-01 17:14 ` unlvsur at live dot com
  2021-03-01 17:35 ` redi at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: unlvsur at live dot com @ 2021-03-01 17:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99327

--- Comment #1 from cqwrteur <unlvsur at live dot com> ---
Created attachment 50277
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50277&action=edit
DJGPP's original errno

This is djgpp crt's original errno.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/99327] ENOTSUP macro does not exist on djgpp crt
  2021-03-01 17:13 [Bug c++/99327] New: ENOTSUP macro does not exist on djgpp crt unlvsur at live dot com
  2021-03-01 17:14 ` [Bug libstdc++/99327] " unlvsur at live dot com
@ 2021-03-01 17:35 ` redi at gcc dot gnu.org
  2021-05-12  9:49 ` redi at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2021-03-01 17:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99327

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |build
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-03-01
             Target|                            |*-pc-msdosdjgpp

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/99327] ENOTSUP macro does not exist on djgpp crt
  2021-03-01 17:13 [Bug c++/99327] New: ENOTSUP macro does not exist on djgpp crt unlvsur at live dot com
  2021-03-01 17:14 ` [Bug libstdc++/99327] " unlvsur at live dot com
  2021-03-01 17:35 ` redi at gcc dot gnu.org
@ 2021-05-12  9:49 ` redi at gcc dot gnu.org
  2021-10-01 19:39 ` cvs-commit at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2021-05-12  9:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99327

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed in my fork:
https://gitlab.com/jonathan-wakely/gcc/-/commit/93847c75473b3509c305e20b60ffe86b120b8e4b

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/99327] ENOTSUP macro does not exist on djgpp crt
  2021-03-01 17:13 [Bug c++/99327] New: ENOTSUP macro does not exist on djgpp crt unlvsur at live dot com
                   ` (2 preceding siblings ...)
  2021-05-12  9:49 ` redi at gcc dot gnu.org
@ 2021-10-01 19:39 ` cvs-commit at gcc dot gnu.org
  2021-10-01 19:54 ` redi at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-01 19:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99327

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:59ffa3e3dba5a7805585c61dd4387c5644249d52

commit r12-4071-g59ffa3e3dba5a7805585c61dd4387c5644249d52
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue May 11 18:47:18 2021 +0100

    libstdc++: Avoid unconditional use of errc::not_supported [PR 99327]

    The errc::not_supported constant is only defined if ENOTSUP is defined,
    which is not true for all targets. Many uses of errc::not_supported in
    the filesystem library do not actually match the intended meaning of
    ENOTSUP described by POSIX. They should be using ENOSYS instead
    (i.e. errc::function_not_supported).

    This change ensures that appropriate error codes are used by the
    filesystem library. The remaining uses of errc::not_supported are
    replaced with a call to a new helper function so that an alternative
    value will be used on targets that don't support errc::not_supported.

    Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

    libstdc++-v3/ChangeLog:

            PR libstdc++/99327
            * src/filesystem/ops-common.h (__unsupported): New function to
            return a suitable error code for missing functionality.
            (posix::off_t): New typedef.
            (posix::*): Set errno to ENOSYS instead of ENOTSUP for no-op
            fallback implementations.
            (do_copy_file): Replace uses of errc::not_supported.
            * src/c++17/fs_ops.cc (fs::copy, fs::copy_file, create_dir)
            (fs::create_directory, fs::create_directory_symlink)
            (fs::create_hard_link, fs::create_symlink, fs::current_path)
            (fs::equivalent, do_stat, fs::file_size, fs::hard_link_count)
            (fs::last_write_time, fs::permissions, fs::read_symlink):
            Replace uses of errc::not_supported.
            (fs::resize_file): Qualify off_t.
            * src/filesystem/ops.cc (fs::copy, fs::copy_file, create_dir)
            (fs::create_directory, fs::create_directory_symlink)
            (fs::create_hard_link, fs::create_symlink, fs::current_path)
            (fs::equivalent, do_stat, fs::file_size, fs::last_write_time)
            (fs::permissions, fs::read_symlink, fs::system_complete):
            Replace uses of errc::not_supported.
            (fs::resize_file): Qualify off_t and enable unconditionally.
            * testsuite/19_diagnostics/system_error/cons-1.cc: Likewise.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/99327] ENOTSUP macro does not exist on djgpp crt
  2021-03-01 17:13 [Bug c++/99327] New: ENOTSUP macro does not exist on djgpp crt unlvsur at live dot com
                   ` (3 preceding siblings ...)
  2021-10-01 19:39 ` cvs-commit at gcc dot gnu.org
@ 2021-10-01 19:54 ` redi at gcc dot gnu.org
  2021-10-01 19:54 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2021-10-01 19:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99327

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Should be fixed on trunk. I don't plan to backport this.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/99327] ENOTSUP macro does not exist on djgpp crt
  2021-03-01 17:13 [Bug c++/99327] New: ENOTSUP macro does not exist on djgpp crt unlvsur at live dot com
                   ` (4 preceding siblings ...)
  2021-10-01 19:54 ` redi at gcc dot gnu.org
@ 2021-10-01 19:54 ` redi at gcc dot gnu.org
  2021-10-02 10:32 ` m.cencora at gmail dot com
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2021-10-01 19:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99327

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/99327] ENOTSUP macro does not exist on djgpp crt
  2021-03-01 17:13 [Bug c++/99327] New: ENOTSUP macro does not exist on djgpp crt unlvsur at live dot com
                   ` (5 preceding siblings ...)
  2021-10-01 19:54 ` redi at gcc dot gnu.org
@ 2021-10-02 10:32 ` m.cencora at gmail dot com
  2021-10-02 14:21 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: m.cencora at gmail dot com @ 2021-10-02 10:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99327

m.cencora at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |m.cencora at gmail dot com

--- Comment #5 from m.cencora at gmail dot com ---
code review comment:
the change in file 'fs_ops.cc', func: 'fs::create_directory' to use
'function_function_not_supported' looks like a typo, isn't it?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/99327] ENOTSUP macro does not exist on djgpp crt
  2021-03-01 17:13 [Bug c++/99327] New: ENOTSUP macro does not exist on djgpp crt unlvsur at live dot com
                   ` (6 preceding siblings ...)
  2021-10-02 10:32 ` m.cencora at gmail dot com
@ 2021-10-02 14:21 ` redi at gcc dot gnu.org
  2021-10-02 20:30 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2021-10-02 14:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99327

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Indeed, thanks.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/99327] ENOTSUP macro does not exist on djgpp crt
  2021-03-01 17:13 [Bug c++/99327] New: ENOTSUP macro does not exist on djgpp crt unlvsur at live dot com
                   ` (7 preceding siblings ...)
  2021-10-02 14:21 ` redi at gcc dot gnu.org
@ 2021-10-02 20:30 ` redi at gcc dot gnu.org
  2023-10-04 11:28 ` cvs-commit at gcc dot gnu.org
  2023-10-04 11:30 ` redi at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2021-10-02 20:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99327

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed at r12-4096, thanks again.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/99327] ENOTSUP macro does not exist on djgpp crt
  2021-03-01 17:13 [Bug c++/99327] New: ENOTSUP macro does not exist on djgpp crt unlvsur at live dot com
                   ` (8 preceding siblings ...)
  2021-10-02 20:30 ` redi at gcc dot gnu.org
@ 2023-10-04 11:28 ` cvs-commit at gcc dot gnu.org
  2023-10-04 11:30 ` redi at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-10-04 11:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99327

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:6ae7641a3e34dfb79f8538965b48e411d825b90f

commit r11-11034-g6ae7641a3e34dfb79f8538965b48e411d825b90f
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue May 11 18:47:18 2021 +0100

    libstdc++: Avoid unconditional use of errc::not_supported [PR 99327]

    The errc::not_supported constant is only defined if ENOTSUP is defined,
    which is not true for all targets. Many uses of errc::not_supported in
    the filesystem library do not actually match the intended meaning of
    ENOTSUP described by POSIX. They should be using ENOSYS instead
    (i.e. errc::function_not_supported).

    This change ensures that appropriate error codes are used by the
    filesystem library. The remaining uses of errc::not_supported are
    replaced with a call to a new helper function so that an alternative
    value will be used on targets that don't support errc::not_supported.

    Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

    libstdc++-v3/ChangeLog:

            PR libstdc++/99327
            * src/filesystem/ops-common.h (__unsupported): New function to
            return a suitable error code for missing functionality.
            (posix::off_t): New typedef.
            (posix::*): Set errno to ENOSYS instead of ENOTSUP for no-op
            fallback implementations.
            (do_copy_file): Replace uses of errc::not_supported.
            * src/c++17/fs_ops.cc (fs::copy, fs::copy_file, create_dir)
            (fs::create_directory, fs::create_directory_symlink)
            (fs::create_hard_link, fs::create_symlink, fs::current_path)
            (fs::equivalent, do_stat, fs::file_size, fs::hard_link_count)
            (fs::last_write_time, fs::permissions, fs::read_symlink):
            Replace uses of errc::not_supported.
            (fs::resize_file): Qualify off_t.
            * src/filesystem/ops.cc (fs::copy, fs::copy_file, create_dir)
            (fs::create_directory, fs::create_directory_symlink)
            (fs::create_hard_link, fs::create_symlink, fs::current_path)
            (fs::equivalent, do_stat, fs::file_size, fs::last_write_time)
            (fs::permissions, fs::read_symlink, fs::system_complete):
            Replace uses of errc::not_supported.
            (fs::resize_file): Qualify off_t and enable unconditionally.
            * testsuite/19_diagnostics/system_error/cons-1.cc: Likewise.

    (cherry picked from commit 59ffa3e3dba5a7805585c61dd4387c5644249d52)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/99327] ENOTSUP macro does not exist on djgpp crt
  2021-03-01 17:13 [Bug c++/99327] New: ENOTSUP macro does not exist on djgpp crt unlvsur at live dot com
                   ` (9 preceding siblings ...)
  2023-10-04 11:28 ` cvs-commit at gcc dot gnu.org
@ 2023-10-04 11:30 ` redi at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2023-10-04 11:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99327

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|12.0                        |11.5

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #4)
> Should be fixed on trunk. I don't plan to backport this.

It turned out that some other backports (including the PR 104161 fixes) were
easier with this one in place, so I backported it for 11.5

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-10-04 11:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-01 17:13 [Bug c++/99327] New: ENOTSUP macro does not exist on djgpp crt unlvsur at live dot com
2021-03-01 17:14 ` [Bug libstdc++/99327] " unlvsur at live dot com
2021-03-01 17:35 ` redi at gcc dot gnu.org
2021-05-12  9:49 ` redi at gcc dot gnu.org
2021-10-01 19:39 ` cvs-commit at gcc dot gnu.org
2021-10-01 19:54 ` redi at gcc dot gnu.org
2021-10-01 19:54 ` redi at gcc dot gnu.org
2021-10-02 10:32 ` m.cencora at gmail dot com
2021-10-02 14:21 ` redi at gcc dot gnu.org
2021-10-02 20:30 ` redi at gcc dot gnu.org
2023-10-04 11:28 ` cvs-commit at gcc dot gnu.org
2023-10-04 11:30 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).