public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gjl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/107201] New: [avr] -nodevicelib not working for devices -mmcu=avr...
Date: Mon, 10 Oct 2022 14:37:56 +0000	[thread overview]
Message-ID: <bug-107201-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 107201
           Summary: [avr] -nodevicelib not working for devices
                    -mmcu=avr...
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

The -nodevicelib option can be used so that the executable is not linked
against -l<device> when a device is specified as -mmcu=<device>.  This is
useful if such a library is not avilable.

This is achieved by the following spec in the device-specs file specs-<device>:

*avrlibc_devicelib:
        %{!nodevicelib:-lavr64dd64}

However, in a spec function, the driver in
./gcc/config/avr/driver-avr.c[c]::avr_devicespecs_file() removes that option
because it thinks that -mmcu=avr* is a device *family* like avr25 or avrxmega2
etc.:

#if defined (WITH_AVRLIBC)
                 " %{mmcu=avr*:" X_NODEVLIB "} %{!mmcu=*:" X_NODEVLIB "}",
#else

where X_NODEVLIB resolves to "%<nodevicelib %<nodevicespecs"

This means that -nodevicelib is removed also for -mmcu=avr* devices, not only
for -mmcu=avr* cores.

All this worked because up to now, no AVR devices where named "avr*", so that
"avr*" worked to identify cores.

             reply	other threads:[~2022-10-10 14:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-10 14:37 gjl at gcc dot gnu.org [this message]
2022-10-11 17:25 ` [Bug target/107201] " gjl at gcc dot gnu.org
2024-01-15 15:17 ` cvs-commit at gcc dot gnu.org
2024-01-16  7:42 ` cvs-commit at gcc dot gnu.org
2024-01-16  8:16 ` cvs-commit at gcc dot gnu.org
2024-01-16  8:18 ` gjl at gcc dot gnu.org
2024-01-16  8:40 ` 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-107201-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).