public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nicow.mattia at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/108287] New: AVR build: gcc/config/avr/t-avr tries to edit the source tree
Date: Wed, 04 Jan 2023 18:02:54 +0000	[thread overview]
Message-ID: <bug-108287-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 108287
           Summary: AVR build: gcc/config/avr/t-avr tries to edit the
                    source tree
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nicow.mattia at gmail dot com
  Target Milestone: ---

This only occurs when building for target=avr.

As per the build instructions, I'm building GCC out of the source tree. The
configure call looks like this:

```
$src/configure \
  --target=avr \
  --prefix=$out \
   ...
```

Here, `$src` is a RO directory, and the build will eventually fail like this:

```
...
g++ -std=gnu++11 
/nix/store/7m0zk6xl14rkgi420mxyl0klssf7dhnb-gcc-src-patched/gcc/config/avr/gen-avr-mmcu-texi.cc
-o gen-avr-mmcu-texi
./gen-avr-mmcu-texi >
/nix/store/7m0zk6xl14rkgi420mxyl0klssf7dhnb-gcc-src-patched/gcc/doc/avr-mmcu.texi
/bin/sh:
/nix/store/7m0zk6xl14rkgi420mxyl0klssf7dhnb-gcc-src-patched/gcc/doc/avr-mmcu.texi:
Permission denied
```

The culprit is `gcc/config/avr/t-avr` at line 94:

```
$(srcdir)/doc/avr-mmcu.texi: gen-avr-mmcu-texi$(build_exeext)
        $(RUN_GEN) ./$< > $@
```

I'm currently using the following patch to work around the issue:

```
diff --git a/gcc/config/avr/t-avr b/gcc/config/avr/t-avr
index deadbeef..deadbeef 100644
--- a/gcc/config/avr/t-avr      2023-01-03 21:56:23
+++ b/gcc/config/avr/t-avr      2023-01-03 21:56:32
@@ -91,9 +91,6 @@
   $(srcdir)/config/avr/avr-arch.h $(TM_H)
        $(CXX_FOR_BUILD) $(CXXFLAGS_FOR_BUILD) $< -o $@ $(INCLUDES)

-$(srcdir)/doc/avr-mmcu.texi: gen-avr-mmcu-texi$(build_exeext)
-       $(RUN_GEN) ./$< > $@
-
 s-device-specs: gen-avr-mmcu-specs$(build_exeext)
        rm -rf device-specs
        mkdir device-specs && cd device-specs && $(RUN_GEN) ../$<
```

             reply	other threads:[~2023-01-04 18:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04 18:02 nicow.mattia at gmail dot com [this message]
2023-01-04 18:08 ` [Bug target/108287] " pinskia at gcc dot gnu.org
2023-01-04 18:08 ` pinskia at gcc dot gnu.org
2023-01-04 18:11 ` nicow.mattia at gmail dot com
2023-01-21 12:33 ` gjl at gcc dot gnu.org
2023-01-21 12:34 ` gjl at gcc dot gnu.org

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=bug-108287-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).