[klibc] [klibc:master] ppc64: build with -mcmodel=small

klibc-bot for Anton Blanchard anton at samba.org
Tue Dec 3 10:57:05 PST 2013


Commit-ID:  cb90a942dcb20ca34ea6d7b2f3df80d28378d871
Gitweb:     http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=cb90a942dcb20ca34ea6d7b2f3df80d28378d871
Author:     Anton Blanchard <anton at samba.org>
AuthorDate: Tue, 3 Dec 2013 18:19:06 +1100
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Tue, 3 Dec 2013 10:53:31 -0800

[klibc] ppc64: build with -mcmodel=small

If available, use -mcmodel=small. klibc is small enough that we
should never hit the limits of the small memory model.

This produces better code, for example:

000000000f003890 <.strcasecmp>:
f003890:       3c a2 ff fe     addis   r5,r2,-2
...
f003898:       38 c5 23 58     addi    r6,r5,9048
...
f0038ac:       7d 46 50 ae     lbzx    r10,r6,r10

vs:

000000000f0037c4 <.strcasecmp>:
f0037c4:       e8 c2 81 48     ld      r6,-32440(r2)
f0037dc:       7d 46 50 ae     lbzx    r10,r6,r10

Signed-off-by: Anton Blanchard <anton at samba.org>
Signed-off-by: H. Peter Anvin <hpa at zytor.com>

---
 usr/klibc/arch/ppc64/MCONFIG | 1 +
 1 file changed, 1 insertion(+)

diff --git a/usr/klibc/arch/ppc64/MCONFIG b/usr/klibc/arch/ppc64/MCONFIG
index 0294c44..1331e05 100644
--- a/usr/klibc/arch/ppc64/MCONFIG
+++ b/usr/klibc/arch/ppc64/MCONFIG
@@ -9,6 +9,7 @@
 
 KLIBCARCHREQFLAGS = -m64
 KLIBCARCHREQFLAGS += $(call cc-option, -mcall-aixdesc, )
+KLIBCARCHREQFLAGS += $(call cc-option, -mcmodel=small, )
 KLIBCOPTFLAGS     += -Os
 KLIBCBITSIZE      = 64
 


More information about the klibc mailing list