switch-coreboot/util/msrtool
Paul Menzel 3059447687 UPSTREAM: msrtool: Remove no-pic from CFLAGS
Commit 7c634ae8 (msrtool: added support for Intel CPUs) adds `no-pic` to
the compiler flags.

GCC 7.0.1 20170316 fails to built with the error below.

```
/usr/bin/ld: msrtool.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: msrutils.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: sys.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: linux.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: freebsd.o: relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
```

Removing the flag causes the build to succeed with GCC 7, 6.3, and clang
4.0.

BUG=none
BRANCH=none
TEST=none

Change-Id: Iba6a3ce9e098c60cf6ec6a6cd6d649df15486b91
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Original-Commit-Id: 459d2198eb
Original-Change-Id: I3d7aed27ce7f84aa27305c68e2d5f14607c58ec8
Original-Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-on: https://review.coreboot.org/18907
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Stefan Tauner <stefan.tauner@gmx.at>
Original-Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Original-Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://chromium-review.googlesource.com/531194
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
2017-06-12 14:15:55 -07:00
..
configure msrtool/configure: change svn to git 2015-12-14 22:52:49 +01:00
COPYING msrtool: Release Candidate 1 2008-11-22 17:13:36 +00:00
cs5536.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
darwin.c UPSTREAM: Use more secure HTTPS URLs for coreboot sites 2017-06-12 08:47:49 -07:00
freebsd.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
geodegx2.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
geodelx.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
intel_atom.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
intel_core1.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
intel_core2_early.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
intel_core2_later.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
intel_nehalem.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
intel_pentium3.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
intel_pentium3_early.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
intel_pentium4_early.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
intel_pentium4_later.c UPSTREAM: util/msrtool: update register for Pentium4_later 2016-08-01 13:44:48 -07:00
k8.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
linux.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
Makefile.in UPSTREAM: msrtool: Remove no-pic from CFLAGS 2017-06-12 14:15:55 -07:00
msrtool.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
msrtool.h UPSTREAM: Use more secure HTTPS URLs for coreboot sites 2017-06-12 08:47:49 -07:00
msrutils.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
README UPSTREAM: msrtool/README: Remove trailing spaces 2016-08-01 13:44:34 -07:00
sys.c UPSTREAM: util/msrtool: Use tabs for indents 2016-10-19 14:06:44 -07:00
TODO msrtool: Use libpci to let system and target probes find PCI devices. 2008-11-25 02:03:16 +00:00

You need to be ROOT or use SUDO to execute MSRTOOL.

Note that you need /dev/cpu/*/msr available to run msrtool in Linux.


syntax: msrtool [-hvqrkl] [-c cpu] [-m system] [-t target ...]
         [-i addr=hi[:]lo] | [-s file] | [-d [:]file] | addr...
  -h     show this help text
  -v     be verbose
  -q     be quiet (overrides -v)
  -r     include [Reserved] values
  -k     list all known systems and targets
  -l     list MSRs and bit fields for current target(s) (-kl for ALL targets!)
  -c     access MSRs on the specified CPU, default=0
  -m     force a system, e.g: -m linux
  -t     force a target, can be used multiple times, e.g: -t geodelx -t cs5536
  -i     immediate mode
         decode hex addr=hi:lo for the target without reading hw value
         e.g: -i 4c00000f=f2f100ff56960004
  -s     stream mode
         read one MSR address per line and append current hw value to the line
         use the filename - for stdin/stdout
         using -l -s ignores input and will output all MSRs with values
  -d     diff mode
         read one address and value per line and compare with current hw value,
         printing differences to stdout. use the filename - to read from stdin
         use :file or :- to reverse diff, normally hw values are considered new
  addr.. direct mode, read and decode values for the given MSR address(es)


Examples:

msrtool 0x20000018

./msrtool 0x200000{18,19,1a,1b,1c,1d} 0x4c0000{0f,14}