#2351: NetBSD defines ELF_ST_TYPE
----------------------------+-----------------------------------------------
Reporter: donn | Owner: igloo
Type: bug | Status: new
Priority: normal | Milestone: 6.10.1
Component: Runtime System | Version: 6.8.2
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Architecture: x86_64 (amd64)
Os: NetBSD |
----------------------------+-----------------------------------------------
Changes (by igloo):
* owner: => igloo
* difficulty: => Unknown
* milestone: => 6.10.1
Old description:
> NetBSD 4.0 defines ELF_ST_TYPE and ELF_ST_BIND already, so these
> definitions for x86_64 in rts/Linker.c should be conditional on non-
> existence,as they are for i386, not just conditional on not-FreeBSD.
>
> --- rts/Linker.c.dist 2008-06-03 10:21:22.000000000 -0700
> +++ rts/Linker.c 2008-06-05 17:01:11.000000000 -0700
> @@ -2612,10 +2612,16 @@
> #define Elf_Sym Elf64_Sym
> #define Elf_Rel Elf64_Rel
> #define Elf_Rela Elf64_Rela
> -#if !defined(freebsd_HOST_OS)
> +#ifndef ELF_ST_TYPE
> #define ELF_ST_TYPE ELF64_ST_TYPE
> +#endif
> +#ifndef ELF_ST_BIND
> #define ELF_ST_BIND ELF64_ST_BIND
> +#endif
> +#ifndef ELF_R_TYPE
> #define ELF_R_TYPE ELF64_R_TYPE
> +#endif
> +#ifndef ELF_R_SYM
> #define ELF_R_SYM ELF64_R_SYM
> #endif
> #else
New description:
NetBSD 4.0 defines ELF_ST_TYPE and ELF_ST_BIND already, so these
definitions for x86_64 in rts/Linker.c should be conditional on non-
existence,as they are for i386, not just conditional on not-FreeBSD.
{{{
--- rts/Linker.c.dist 2008-06-03 10:21:22.000000000 -0700
+++ rts/Linker.c 2008-06-05 17:01:11.000000000 -0700
@@ -2612,10 +2612,16 @@
#define Elf_Sym Elf64_Sym
#define Elf_Rel Elf64_Rel
#define Elf_Rela Elf64_Rela
-#if !defined(freebsd_HOST_OS)
+#ifndef ELF_ST_TYPE
#define ELF_ST_TYPE ELF64_ST_TYPE
+#endif
+#ifndef ELF_ST_BIND
#define ELF_ST_BIND ELF64_ST_BIND
+#endif
+#ifndef ELF_R_TYPE
#define ELF_R_TYPE ELF64_R_TYPE
+#endif
+#ifndef ELF_R_SYM
#define ELF_R_SYM ELF64_R_SYM
#endif
#else
}}}
Comment:
Thanks for the patch! We'll take a look for 6.10.1.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2351#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs