* make headers_install headers problem on sparc64
@ 2006-10-18 22:37 andrew
2006-10-19 7:50 ` David Woodhouse
2006-10-19 10:54 ` andrew
0 siblings, 2 replies; 9+ messages in thread
From: andrew @ 2006-10-18 22:37 UTC (permalink / raw)
To: linux-kernel; +Cc: dwmw2
Hi david, lkml.
I found a message where you said
"If you have problems with the exported headers (other
than that some userspace abuses headers which it shouldn't), then
_shout_. Please don't just let them go unreported."
So,
Using headers exported from vanilla linux 2.6.18.1 and compiling the
elftoaout part of the debian sparc-utils package, I get some breakage
here:
In file included from /usr/include/asm/elf.h:5,
from /usr/include/linux/elf.h:7,
from elftoaout.c:24:
due to tlb_type, cheetah et al being undefined in this part of
asm-sparc64/elf.h:
bash-3.1# tail -n30 /pkg/linux/include/asm-sparc64/elf.h
/* This yields a mask that user programs can use to figure out what
instruction set this cpu supports. */
/* On Ultra, we support all of the v8 capabilities. */
static __inline__ unsigned int sparc64_elf_hwcap(void)
{
unsigned int cap = (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR |
HWCAP_SPARC_SWAP | HWCAP_SPARC_MULDIV |
HWCAP_SPARC_V9);
if (tlb_type == cheetah || tlb_type == cheetah_plus)
cap |= HWCAP_SPARC_ULTRA3;
else if (tlb_type == hypervisor)
cap |= HWCAP_SPARC_BLKINIT;
return cap;
}
#define ELF_HWCAP sparc64_elf_hwcap();
/* This yields a string that ld.so will use to load implementation
specific libraries for optimization. This is more specific in
intent than poking at uname or /proc/cpuinfo. */
#define ELF_PLATFORM (NULL)
#endif /* !(__ASM_SPARC64_ELF_H) */
Hope this is useful
Andrew Walrond
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: make headers_install headers problem on sparc64 2006-10-18 22:37 make headers_install headers problem on sparc64 andrew @ 2006-10-19 7:50 ` David Woodhouse 2006-10-19 9:03 ` andrew 2006-10-19 10:54 ` andrew 1 sibling, 1 reply; 9+ messages in thread From: David Woodhouse @ 2006-10-19 7:50 UTC (permalink / raw) To: andrew; +Cc: linux-kernel, davem On Wed, 2006-10-18 at 22:37 +0000, andrew@walrond.org wrote: > Hi david, lkml. > > I found a message where you said > > "If you have problems with the exported headers (other > than that some userspace abuses headers which it shouldn't), then > _shout_. Please don't just let them go unreported." Thank you. > So, > > Using headers exported from vanilla linux 2.6.18.1 and compiling the > elftoaout part of the debian sparc-utils package, I get some breakage > here: > > In file included from /usr/include/asm/elf.h:5, > from /usr/include/linux/elf.h:7, > from elftoaout.c:24: > > due to tlb_type, cheetah et al being undefined in this part of > asm-sparc64/elf.h: > > Hm, yes. There's still a lot of crap being exposed there that we really don't need to be showing. Try this entirely untested patch... The sparc64 version could do with something similar, too. ---- [SPARC] Clean up asm-sparc/elf.h pollution in userspace. We don't need to export sparc_elf_hwcap() to userspace, and it doesn't build there. Remove it by moving it inside #ifdef __KERNEL__, along with some other things which don't need to be exported. Signed-off-by: David Woodhouse <dwmw2@infradead.org> diff --git a/include/asm-sparc/elf.h b/include/asm-sparc/elf.h index 83a3dd1..aaf6ef4 100644 --- a/include/asm-sparc/elf.h +++ b/include/asm-sparc/elf.h @@ -8,11 +8,6 @@ #define __ASMSPARC_ELF_H #include <asm/ptrace.h> -#ifdef __KERNEL__ -#include <asm/mbus.h> -#include <asm/uaccess.h> -#endif - /* * Sparc section types */ @@ -77,6 +72,23 @@ typedef unsigned long elf_greg_t; #define ELF_NGREG 38 typedef elf_greg_t elf_gregset_t[ELF_NGREG]; +typedef struct { + union { + unsigned long pr_regs[32]; + double pr_dregs[16]; + } pr_fr; + unsigned long __unused; + unsigned long pr_fsr; + unsigned char pr_qcnt; + unsigned char pr_q_entrysize; + unsigned char pr_en; + unsigned int pr_q[64]; +} elf_fpregset_t; + +#ifdef __KERNEL__ +#include <asm/mbus.h> +#include <asm/uaccess.h> + /* Format is: * G0 --> G7 * O0 --> O7 @@ -99,20 +111,7 @@ do { unsigned long *dest = &(__elf_regs[ dest[34] = src->npc; \ dest[35] = src->y; \ dest[36] = dest[37] = 0; /* XXX */ \ -} while(0); /* Janitors: Don't touch this colon. */ - -typedef struct { - union { - unsigned long pr_regs[32]; - double pr_dregs[16]; - } pr_fr; - unsigned long __unused; - unsigned long pr_fsr; - unsigned char pr_qcnt; - unsigned char pr_q_entrysize; - unsigned char pr_en; - unsigned int pr_q[64]; -} elf_fpregset_t; +} while(0); /* Janitors: Don't touch this semicolon. */ #define ELF_CORE_COPY_TASK_REGS(__tsk, __elf_regs) \ ({ ELF_CORE_COPY_REGS((*(__elf_regs)), (__tsk)->thread.kregs); 1; }) @@ -165,8 +164,8 @@ #define ELF_HWCAP ((ARCH_SUN4C_SUN4) ? 0 #define ELF_PLATFORM (NULL) -#ifdef __KERNEL__ #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) -#endif + +#endif /* __KERNEL__ */ #endif /* !(__ASMSPARC_ELF_H) */ -- dwmw2 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: make headers_install headers problem on sparc64 2006-10-19 7:50 ` David Woodhouse @ 2006-10-19 9:03 ` andrew 0 siblings, 0 replies; 9+ messages in thread From: andrew @ 2006-10-19 9:03 UTC (permalink / raw) To: linux-kernel On Thu, Oct 19, 2006 at 08:50:22AM +0100, David Woodhouse wrote: > > Hm, yes. There's still a lot of crap being exposed there that we really > don't need to be showing. Try this entirely untested patch... > > The sparc64 version could do with something similar, too. > I'm on sparc64 (pure 64bit) so I can't test your patch. For reference, I used this (not as smart as yours) patch: diff -Naur linux-2.6.18.1/include/asm-sparc64/elf.h linux-2.6.18.1-fix/include/asm-sparc64/elf.h --- linux-2.6.18.1/include/asm-sparc64/elf.h 2006-09-20 03:42:06.000000000 +0000 +++ linux-2.6.18.1-fix/include/asm-sparc64/elf.h 2006-10-19 08:57:11.000000000 +0000 @@ -142,6 +142,7 @@ #define ELF_ET_DYN_BASE 0x0000010000000000UL #endif +#ifdef __KERNEL__ /* This yields a mask that user programs can use to figure out what instruction set this cpu supports. */ @@ -163,6 +164,8 @@ #define ELF_HWCAP sparc64_elf_hwcap(); +#endif + /* This yields a string that ld.so will use to load implementation specific libraries for optimization. This is more specific in intent than poking at uname or /proc/cpuinfo. */ Andrew Walrond ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: make headers_install headers problem on sparc64 2006-10-18 22:37 make headers_install headers problem on sparc64 andrew 2006-10-19 7:50 ` David Woodhouse @ 2006-10-19 10:54 ` andrew 2006-10-19 11:10 ` andrew 1 sibling, 1 reply; 9+ messages in thread From: andrew @ 2006-10-19 10:54 UTC (permalink / raw) To: linux-kernel; +Cc: David Another problem; when compiling reiserfsprogs 3.6.19 there is a header missing: ../include/reiserfs_fs.h:41:27: error: asm/unaligned.h: No such file or directory I see this file exists in the kernel sources, but not in the exported headers. Andrew ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: make headers_install headers problem on sparc64 2006-10-19 10:54 ` andrew @ 2006-10-19 11:10 ` andrew 2006-10-19 11:34 ` David Woodhouse 0 siblings, 1 reply; 9+ messages in thread From: andrew @ 2006-10-19 11:10 UTC (permalink / raw) To: linux-kernel, David On Thu, Oct 19, 2006 at 10:54:41AM +0000, andrew@walrond.org wrote: > > Another problem; when compiling reiserfsprogs 3.6.19 there is a header > missing: > > ../include/reiserfs_fs.h:41:27: error: asm/unaligned.h: No such file > or directory > > > I see this file exists in the kernel sources, but not in the exported > headers. > Simply copying asm-generic/unaligned.h into the sanitised header tree under asm/ solves the problem, so should headers_install just include unaligned.h ? > Andrew PS Great job BTW; I have encountered amazingly few problems using the sanitised headers created with headers_install. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: make headers_install headers problem on sparc64 2006-10-19 11:10 ` andrew @ 2006-10-19 11:34 ` David Woodhouse 2006-10-19 11:37 ` andrew 2006-12-30 10:38 ` Mike Frysinger 0 siblings, 2 replies; 9+ messages in thread From: David Woodhouse @ 2006-10-19 11:34 UTC (permalink / raw) To: andrew; +Cc: linux-kernel On Thu, 2006-10-19 at 11:10 +0000, andrew@walrond.org wrote: > Simply copying asm-generic/unaligned.h into the sanitised header tree > under asm/ solves the problem, so should headers_install just include > unaligned.h ? No. That header should not be exposed to userspace. Just fix reiserfsprogs instead. It's not as if unaligned access is _hard_ -- you just have to ask the compiler to do it for you: http://cvs.fedora.redhat.com/viewcvs/rpms/reiserfs-utils/devel/header-fix.patch?view=markup -- dwmw2 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: make headers_install headers problem on sparc64 2006-10-19 11:34 ` David Woodhouse @ 2006-10-19 11:37 ` andrew 2006-10-19 11:43 ` David Woodhouse 2006-12-30 10:38 ` Mike Frysinger 1 sibling, 1 reply; 9+ messages in thread From: andrew @ 2006-10-19 11:37 UTC (permalink / raw) To: David Woodhouse; +Cc: linux-kernel On Thu, Oct 19, 2006 at 12:34:32PM +0100, David Woodhouse wrote: > > No. That header should not be exposed to userspace. Just fix > reiserfsprogs instead. It's not as if unaligned access is _hard_ -- you > just have to ask the compiler to do it for you: > > http://cvs.fedora.redhat.com/viewcvs/rpms/reiserfs-utils/devel/header-fix.patch?view=markup > Thanks for the link Andrew ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: make headers_install headers problem on sparc64 2006-10-19 11:37 ` andrew @ 2006-10-19 11:43 ` David Woodhouse 0 siblings, 0 replies; 9+ messages in thread From: David Woodhouse @ 2006-10-19 11:43 UTC (permalink / raw) To: andrew; +Cc: linux-kernel On Thu, 2006-10-19 at 11:37 +0000, andrew@walrond.org wrote: > On Thu, Oct 19, 2006 at 12:34:32PM +0100, David Woodhouse wrote: > > > > No. That header should not be exposed to userspace. Just fix > > reiserfsprogs instead. It's not as if unaligned access is _hard_ -- you > > just have to ask the compiler to do it for you: > > > > http://cvs.fedora.redhat.com/viewcvs/rpms/reiserfs-utils/devel/header-fix.patch?view=markup > > > Thanks for the link Fedora Core 6 is already shipping with the output of 'make headers_install'. This means that in general, if userspace is misbehaving and it's something we ship in Fedora Core, Extras or Livna, we're going to have fixed it up already. So Fedora CVS is a good place to look, although such fixes all should have been pushed upstream rather than just languishing in our packages. -- dwmw2 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: make headers_install headers problem on sparc64 2006-10-19 11:34 ` David Woodhouse 2006-10-19 11:37 ` andrew @ 2006-12-30 10:38 ` Mike Frysinger 1 sibling, 0 replies; 9+ messages in thread From: Mike Frysinger @ 2006-12-30 10:38 UTC (permalink / raw) To: David Woodhouse; +Cc: andrew, linux-kernel On 10/19/06, David Woodhouse <dwmw2@infradead.org> wrote: > No. That header should not be exposed to userspace. Just fix > reiserfsprogs instead. It's not as if unaligned access is _hard_ -- you > just have to ask the compiler to do it for you: reiserfsprogs 3.6.20 already handles the case where asm/unaligned.h isnt installed ... i just wouldnt suggest using that version as it wont even compile on big endian machines and doesnt work with non-standard journals ;) -mike ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-12-30 10:38 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2006-10-18 22:37 make headers_install headers problem on sparc64 andrew 2006-10-19 7:50 ` David Woodhouse 2006-10-19 9:03 ` andrew 2006-10-19 10:54 ` andrew 2006-10-19 11:10 ` andrew 2006-10-19 11:34 ` David Woodhouse 2006-10-19 11:37 ` andrew 2006-10-19 11:43 ` David Woodhouse 2006-12-30 10:38 ` Mike Frysinger
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®