public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: HHN <harihara.sn@gmail.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: Errors when trying to use C++ modules with cmake and GCC
Date: Wed, 8 Feb 2023 10:35:07 +0000	[thread overview]
Message-ID: <CAH6eHdTj50gtxJW2p66YAUYhe4M5kUT7_KQeY9OwLXES+da7KA@mail.gmail.com> (raw)
In-Reply-To: <CAG6c7rXQFb1O4tR0muBXLt1JH3DrF7BWeJ-irOxQayd8-HAhfg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3602 bytes --]

On Wed, 8 Feb 2023, 09:49 HHN, <harihara.sn@gmail.com> wrote:

> The patches suggested have worked to generate modules, there must have
> been some error on my end when i tried previously. But unfortunately when I
> try to compile HPX with these patches I face a couple of errors.
>

That's a warning, not an error.


Any help would be appreciated. I have tried to do a diff between the
> successful compile logs (G++-11) and the patches suggested and attached the
> file. grep for "/home/hhn/makes/gcc-modules-install/" might help focus on
> the warnings more easily.
>
> Just to summarise the warnings are mostly
> 1.
> /home/hhn/makes/gcc-modules-install/usr/local/include/c++/13.0.0/atomic:287:22:
> warning: ‘unsigned int __atomic_load_4(const volatile void*, int)’ writing
> 4 bytes into a region of size 0 overflows the destination
> [-Wstringop-overflow=]
>   287 |         __atomic_load(std::__addressof(_M_i), __ptr, int(__m));
>
> 2.
> /home/hhn/makes/gcc-modules-install/usr/local/include/c++/13.0.0/bits/new_allocator.h:165:33:
> note: call to ‘void operator delete(void*, std::size_t)’ here
>   165 |         _GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n));
>
> On Wed, Feb 1, 2023 at 4:31 PM Jonathan Wakely <jwakely.gcc@gmail.com>
> wrote:
>
>> On Wed, 1 Feb 2023 at 10:53, HHN via Gcc-help <gcc-help@gcc.gnu.org>
>> wrote:
>> >
>> > I have been working on upgrading the HPX build system to support C++
>> > modules, while trying to experiment with GCC support for C++ modules, I
>> > keep running into this issue of unrecognized command-line options.
>> >
>> > `
>> > g++: error: unrecognized command-line option
>> > ‘-fdep-file=CMakeFiles/std_module_example.dir/t3.cxx.o.ddi’
>> > g++: error: unrecognized command-line option
>> > ‘-fdep-output=CMakeFiles/std_module_example.dir/t3.cxx.o’
>> > g++: error: unrecognized command-line option ‘-fdep-format=trtbd’
>>
>> [...]
>>
>> > I have tried this with g++ 11.3, g++ 12.1 installed using ubuntu package
>> > managers,
>>
>> As you were told in the cmake forum by Ben B., the patches to add
>> -fdep-file etc. are not yet in GCC, so of course it doesn't work with
>> releases from more than a year ago.
>>
>> > I have also tried the same using this certain patch
>> > <https://github.com/mathstuf/gcc/tree/p1689r5> as suggested by the
>> user on
>> > an online forum
>> > <https://discourse.cmake.org/t/module-support-for-g-and-clang/7367/2>.
>>
>> That user is the person who wrote the patch to add -fdep-file, so you
>> should listen to them. If it still doesn't work with that patch, then
>> you probably didn't apply the patch correctly.
>>
>> > I have also tried the same using the master
>> > <https://github.com/gcc-mirror/gcc> and devel/c++-modules
>> > <https://github.com/gcc-mirror/gcc/tree/devel/c++-modules> branch on
>> gcc
>> > repo.
>>
>> Obviously it's not going to work with those branches, because the
>> patches to add -fdep-file support are not part of GCC yet, as Ben B.
>> already told you.
>>
>> > All of them have given the same errors. Also the devel/c++-modules
>> branch
>> > compiles to g++ version of g++ (GCC) 11.0.0 20210203 (experimental)
>> > [c++-modules revision 20230201-1505], while the master branch has
>> > version g++ (GCC) 13.0.1 20230201 (experimental).
>>
>> Don't use the devel/c++-modules branch. It was used two+ years ago for
>> the initial work on modules, but the master branch now has all that
>> work and numerous improvements.
>>
>
>
> --
> Hari Hara Naveen
>

  reply	other threads:[~2023-02-08 10:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-01 10:52 HHN
2023-02-01 11:00 ` Jonathan Wakely
2023-02-08  9:48   ` HHN
2023-02-08 10:35     ` Jonathan Wakely [this message]
2023-02-08 12:14       ` HHN
2023-02-08 12:27         ` Jonathan Wakely
2023-02-08 12:32           ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH6eHdTj50gtxJW2p66YAUYhe4M5kUT7_KQeY9OwLXES+da7KA@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=harihara.sn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).