Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Florian Fainelli <florian@openwrt.org>
To: linux-mips@linux-mips.org, ralf@linux-mips.org,
	David Daney <ddaney@caviumnetworks.com>
Subject: [PATCH] OCTEON: workaround linking failures with gcc-4.4.x 32-bits toolchains
Date: Thu, 29 Jul 2010 00:13:07 +0200	[thread overview]
Message-ID: <201007290013.08797.florian@openwrt.org> (raw)

When building with a gcc-4.4.x toolchain that is configured to produce 32-bits
executables by default, we will produce __lshrti3 in sched_clock() which is
never resolved so the kernel fails to link. Unconditionally use the inline
assembly version as suggested by David Daney, which works around the issue.

CC: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
diff --git a/arch/mips/cavium-octeon/csrc-octeon.c b/arch/mips/cavium-octeon/csrc-octeon.c
index 0bf4bbe..36400d2 100644
--- a/arch/mips/cavium-octeon/csrc-octeon.c
+++ b/arch/mips/cavium-octeon/csrc-octeon.c
@@ -53,7 +53,6 @@ static struct clocksource clocksource_mips = {
 unsigned long long notrace sched_clock(void)
 {
 	/* 64-bit arithmatic can overflow, so use 128-bit.  */
-#if (__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ <= 3))
 	u64 t1, t2, t3;
 	unsigned long long rv;
 	u64 mult = clocksource_mips.mult;
@@ -73,13 +72,6 @@ unsigned long long notrace sched_clock(void)
 		: [cnt] "r" (cnt), [mult] "r" (mult), [shift] "r" (shift)
 		: "hi", "lo");
 	return rv;
-#else
-	/* GCC > 4.3 do it the easy way.  */
-	unsigned int __attribute__((mode(TI))) t;
-	t = read_c0_cvmcount();
-	t = t * clocksource_mips.mult;
-	return (unsigned long long)(t >> clocksource_mips.shift);
-#endif
 }
 
 void __init plat_time_init(void)

             reply	other threads:[~2010-07-28 22:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-28 22:13 Florian Fainelli [this message]
2010-07-28 22:15 ` [PATCH] OCTEON: workaround linking failures with gcc-4.4.x 32-bits toolchains David Daney
2010-08-02 14:59   ` Ralf Baechle
2010-08-02 16:51     ` David Daney

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=201007290013.08797.florian@openwrt.org \
    --to=florian@openwrt.org \
    --cc=ddaney@caviumnetworks.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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