All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@convergence.de>
To: linux-mips@oss.sgi.com
Subject: Q: -mcpu= vs. -march= for VR41xx specific instructions
Date: Thu, 14 Mar 2002 18:25:02 +0100	[thread overview]
Message-ID: <20020314172502.GA5365@convergence.de> (raw)

I am trying to implement power management for an embedded
device using a NEC VR4120 CPU core, which has the special
instructions "standby", "suspend" and "hibernate".

I use a toolchain based on binutils 2.12.90.0.1 and
gcc 2.95.4-debian.

To use that instructions I have to pass -march=vr4100
to the assembler. Unfortunately, -march and -mcpu cannot
be used together, so first I changed arch/mips/Makefile
from
  GCCFLAGS += -mcpu=r4600 -mips2 -Wa,--trap
to
  GCCFLAGS += -Wa,-march=vr4100 -mips2 -Wa,--trap

This works, but I am unshure what the effects of the
missing -mcpu switch are wrt the code generated by gcc.
AFAICS the kernel still works, but is the generated
code slower or subtly incorrect?

Then I the tried to compile the kernel with the standard
GCCFLAGS, setting -march=vr4100 only for the one
file which contains the standby/suspend/hibernate instructions.
This fails a link time with:

  mips-linux-ld: power.o: uses different e_flags (0x1100) fields than previous modules (0x1000)
  Bad value: failed to merge target specific data of file power.o

I looked at an old arch/mips/Makefile from
http://sourceforge.net/projects/linux-vr/, which has:
  CFLAGS += -mcpu=r4600 -mips2 -Wa,-m4100,--trap
This does not work with my toolchain.

So I think I need either:
- make gas accept -march=vr4100 along with -mcpu=r4600 (or -mcpu=r4100?)
- or have a ".set vr4100" directive to enable the vr41xx specific
  instructions where needed, without changing the flags in the
  ELF header
- or make the linker link modules with different (but compatible) e_flags
- or is "GCCFLAGS += -Wa,-march=vr4100 -mips2 -Wa,--trap" perfect?


Please, does anybody have suggestions how to solve this issue?


Regards,
Johannes

             reply	other threads:[~2002-03-14 17:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-14 17:25 Johannes Stezenbach [this message]
2002-03-14 17:47 ` Q: -mcpu= vs. -march= for VR41xx specific instructions Jim Paris
2002-03-14 18:10 ` Thiemo Seufer
2002-03-14 18:34   ` Johannes Stezenbach

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=20020314172502.GA5365@convergence.de \
    --to=js@convergence.de \
    --cc=linux-mips@oss.sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.