public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/108287] New: AVR build: gcc/config/avr/t-avr tries to edit the source tree
@ 2023-01-04 18:02 nicow.mattia at gmail dot com
  2023-01-04 18:08 ` [Bug target/108287] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: nicow.mattia at gmail dot com @ 2023-01-04 18:02 UTC (permalink / raw)
  To: gcc-bugs

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) ../$<
```

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

end of thread, other threads:[~2023-01-21 12:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-04 18:02 [Bug other/108287] New: AVR build: gcc/config/avr/t-avr tries to edit the source tree nicow.mattia at gmail dot com
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

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).