All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org, linux-arch@vger.kernel.org,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Andi Kleen <andi@firstfloor.org>
Subject: Re: [PATCH/RFC] m68k: Add -ffreestanding to KBUILD_CFLAGS
Date: Wed, 10 Apr 2013 12:18:05 +0200	[thread overview]
Message-ID: <51653C5D.4060408@suse.cz> (raw)
In-Reply-To: <1365585879-5321-1-git-send-email-geert@linux-m68k.org>

(Added Andi to CC)

On 10.4.2013 11:24, Geert Uytterhoeven wrote:
[...]
> E.g. gcc turned
> 
>     strncat(name, "%d", 2);
> 
> into a call to strlen() and a 16-bit store, causing a link failure, as
> arch/m68k/include/asm/string.h provides strlen() using a macro:
> 
>     ERROR: "strlen" [net/ipv4/ip_tunnel.ko] undefined!
[...]
> QUESTION: Should we re-enable -ffreestanding in the main Makefile instead?
> 
> It was removed in
> 
> commit 6edfba1b33c701108717f4e036320fc39abe1912
> Author: Andi Kleen <ak@suse.de>
> Date:   Sat Mar 25 16:29:49 2006 +0100
> 
>     [PATCH] x86_64: Don't define string functions to builtin

My understanding is, that with -fnobuiltin, the compiler is not allowed
to make assumptions about functions if it does not see their definition,
even if they resemble standard functions. E.g. on x86_64, strlen() is
out-of-line, so gcc would have to assume, that strcmp() has side
effects. How about just naming the m68k inline function 'strlen'?

Michal

WARNING: multiple messages have this Message-ID (diff)
From: Michal Marek <mmarek@suse.cz>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@vger.kernel.org, linux-arch@vger.kernel.org,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Andi Kleen <andi@firstfloor.org>
Subject: Re: [PATCH/RFC] m68k: Add -ffreestanding to KBUILD_CFLAGS
Date: Wed, 10 Apr 2013 12:18:05 +0200	[thread overview]
Message-ID: <51653C5D.4060408@suse.cz> (raw)
In-Reply-To: <1365585879-5321-1-git-send-email-geert@linux-m68k.org>

(Added Andi to CC)

On 10.4.2013 11:24, Geert Uytterhoeven wrote:
[...]
> E.g. gcc turned
> 
>     strncat(name, "%d", 2);
> 
> into a call to strlen() and a 16-bit store, causing a link failure, as
> arch/m68k/include/asm/string.h provides strlen() using a macro:
> 
>     ERROR: "strlen" [net/ipv4/ip_tunnel.ko] undefined!
[...]
> QUESTION: Should we re-enable -ffreestanding in the main Makefile instead?
> 
> It was removed in
> 
> commit 6edfba1b33c701108717f4e036320fc39abe1912
> Author: Andi Kleen <ak@suse.de>
> Date:   Sat Mar 25 16:29:49 2006 +0100
> 
>     [PATCH] x86_64: Don't define string functions to builtin

My understanding is, that with -fnobuiltin, the compiler is not allowed
to make assumptions about functions if it does not see their definition,
even if they resemble standard functions. E.g. on x86_64, strlen() is
out-of-line, so gcc would have to assume, that strcmp() has side
effects. How about just naming the m68k inline function 'strlen'?

Michal

  parent reply	other threads:[~2013-04-10 10:18 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10  9:24 [PATCH/RFC] m68k: Add -ffreestanding to KBUILD_CFLAGS Geert Uytterhoeven
2013-04-10  9:24 ` Geert Uytterhoeven
2013-04-10 10:18 ` Michal Marek
2013-04-10 10:18 ` Michal Marek [this message]
2013-04-10 10:18   ` Michal Marek
2013-04-10 10:59   ` Geert Uytterhoeven
2013-04-10 10:59   ` Geert Uytterhoeven
2013-04-10 10:59     ` Geert Uytterhoeven
2013-04-10 12:26     ` Michal Marek
2013-04-10 12:26       ` Michal Marek
2013-04-10 12:26       ` Michal Marek
2013-04-10 14:19       ` Geert Uytterhoeven
2013-04-10 14:19       ` Geert Uytterhoeven
2013-04-10 14:19         ` Geert Uytterhoeven
2013-04-10 15:22         ` Michal Marek
2013-04-10 15:22           ` Michal Marek
2013-04-10 15:22           ` Michal Marek
2013-04-11 18:04           ` Geert Uytterhoeven
2013-04-11 18:04             ` Geert Uytterhoeven
2013-04-12 19:47             ` Geert Uytterhoeven
2013-04-12 19:47             ` Geert Uytterhoeven
2013-04-12 19:47               ` Geert Uytterhoeven
2013-04-11 18:04           ` Geert Uytterhoeven
2013-04-24 12:01       ` Thorsten Glaser
2013-04-24 12:10         ` Geert Uytterhoeven
2013-04-24 15:54           ` Thorsten Glaser
2013-04-10 17:48   ` Andi Kleen
2013-04-10 17:48   ` Andi Kleen
2013-04-10 17:48     ` Andi Kleen
2013-04-10 17:06 ` David Miller
2013-04-10 17:06 ` David Miller
2013-04-10 17:06   ` David Miller
2013-04-23 15:00 ` Thorsten Glaser

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=51653C5D.4060408@suse.cz \
    --to=mmarek@suse.cz \
    --cc=andi@firstfloor.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.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 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.