diff options
author | joerg <joerg@pkgsrc.org> | 2015-02-23 18:20:21 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2015-02-23 18:20:21 +0000 |
commit | bb0dcf4a4bd99d7fffb380bec8f736cd7dec0b7e (patch) | |
tree | 4e2a6d2720194cb5d40f3fce96d270f61ea7f439 /devel/bin86 | |
parent | d4f6f6a15c14c6959ed0f023c3ff721b4cf4afde (diff) | |
download | pkgsrc-bb0dcf4a4bd99d7fffb380bec8f736cd7dec0b7e.tar.gz |
Fix format strings. Use fixed sized types to hopefully get it to work on
all little endian platforms.
Diffstat (limited to 'devel/bin86')
-rw-r--r-- | devel/bin86/distinfo | 8 | ||||
-rw-r--r-- | devel/bin86/patches/patch-ab | 28 | ||||
-rw-r--r-- | devel/bin86/patches/patch-ac | 45 | ||||
-rw-r--r-- | devel/bin86/patches/patch-ld_dumps.c | 13 | ||||
-rw-r--r-- | devel/bin86/patches/patch-ld_objchop.c | 39 |
5 files changed, 104 insertions, 29 deletions
diff --git a/devel/bin86/distinfo b/devel/bin86/distinfo index 11325ecec29..bb528c69d1b 100644 --- a/devel/bin86/distinfo +++ b/devel/bin86/distinfo @@ -1,8 +1,10 @@ -$NetBSD: distinfo,v 1.3 2011/08/29 01:39:11 dholland Exp $ +$NetBSD: distinfo,v 1.4 2015/02/23 18:20:21 joerg Exp $ SHA1 (bin86-0.16.17.tar.gz) = 656f06b4b26d08412132e338baa25e42d713eeec RMD160 (bin86-0.16.17.tar.gz) = b0ae5aff632a3528214749e256f5ab498f1a7fa4 Size (bin86-0.16.17.tar.gz) = 152400 bytes SHA1 (patch-aa) = f4a4fcc5cb51fb428a660d0fc70579f73e2de719 -SHA1 (patch-ab) = 31ae26539959cc1484d2754772f97dd85dc47716 -SHA1 (patch-ac) = 2f6e342013396561278bb78571148ec7ce3d32d2 +SHA1 (patch-ab) = 97fe4a9bc09b2361cea9619fccb8f9db5a0bacd1 +SHA1 (patch-ac) = f29a028cf8da780d3a2d2ccf611133fe219453a3 +SHA1 (patch-ld_dumps.c) = 9f967a127e29515919274e5495002d654beb1a4a +SHA1 (patch-ld_objchop.c) = fe253f6b6698b5c0eb58914d660cdb99c791539c diff --git a/devel/bin86/patches/patch-ab b/devel/bin86/patches/patch-ab index 0aa58092806..32edf5a9860 100644 --- a/devel/bin86/patches/patch-ab +++ b/devel/bin86/patches/patch-ab @@ -1,20 +1,26 @@ -$NetBSD: patch-ab,v 1.2 2011/08/29 01:39:12 dholland Exp $ +$NetBSD: patch-ab,v 1.3 2015/02/23 18:20:21 joerg Exp $ - build on LP64 - fix mismatched return statements, which clang dislikes --- ld/catimage.c.orig 1997-07-22 21:38:12.000000000 +0000 +++ ld/catimage.c -@@ -27,6 +27,8 @@ - #error "Compile error: struct exec invalid (long not 32 bit ?)" - #endif +@@ -21,11 +21,11 @@ + */ + #include <stdio.h> ++#include <stdlib.h> ++#include <string.h> + #include "x86_aout.h" + +-#ifndef __OUT_OK +-#error "Compile error: struct exec invalid (long not 32 bit ?)" +-#endif +static void patch_bin(long, int); -+ + unsigned long text_offt[10]; /* Locations to patch (0=don't) */ unsigned long data_offt[10]; - -@@ -35,11 +37,12 @@ FILE * ofd; +@@ -35,11 +34,12 @@ FILE * ofd; FILE * ifd = 0; struct exec header; @@ -28,7 +34,7 @@ $NetBSD: patch-ab,v 1.2 2011/08/29 01:39:12 dholland Exp $ int image_id; if( argc < 3 || argc > 11 ) -@@ -59,8 +62,10 @@ char ** argv; +@@ -59,8 +59,10 @@ char ** argv; open_obj(argv[image_id+2]); printf("File %-14s seg=0x%04lx text=0x%04lx data=0x%04lx\n", @@ -41,7 +47,7 @@ $NetBSD: patch-ab,v 1.2 2011/08/29 01:39:12 dholland Exp $ text_off = image_offset; if( header.a_flags & A_SEP ) -@@ -90,7 +95,7 @@ char ** argv; +@@ -90,7 +92,7 @@ char ** argv; fputc('\0', ofd); fclose(ofd); @@ -50,7 +56,7 @@ $NetBSD: patch-ab,v 1.2 2011/08/29 01:39:12 dholland Exp $ if( ifd ) fclose(ifd); exit(0); -@@ -139,6 +144,7 @@ long out_offset, in_offset, length; +@@ -139,6 +141,7 @@ long out_offset, in_offset, length; } } @@ -58,7 +64,7 @@ $NetBSD: patch-ab,v 1.2 2011/08/29 01:39:12 dholland Exp $ patch_bin(file_off, value) long file_off; int value; -@@ -162,7 +168,7 @@ read_symtable() +@@ -162,7 +165,7 @@ read_symtable() { struct nlist item; int nitems; diff --git a/devel/bin86/patches/patch-ac b/devel/bin86/patches/patch-ac index c3bd0e3b5da..1c138f8a7af 100644 --- a/devel/bin86/patches/patch-ac +++ b/devel/bin86/patches/patch-ac @@ -1,19 +1,34 @@ -$NetBSD: patch-ac,v 1.1 2008/08/02 21:46:33 dholland Exp $ +$NetBSD: patch-ac,v 1.2 2015/02/23 18:20:21 joerg Exp $ ---- ld/x86_aout.h~ 2003-01-28 17:17:14.000000000 -0500 -+++ ld/x86_aout.h 2008-08-02 17:40:03.000000000 -0400 -@@ -12,6 +12,9 @@ - #if defined(i386) || defined(__BCC__) || defined(MSDOS) - typedef long Long; - #define __OUT_OK 1 -+#elif defined(_LP64) -+typedef int Long; -+#define __OUT_OK 1 - #else - typedef char Long[4]; - #endif -@@ -77,7 +80,7 @@ struct exec { /* a.out header */ - #endif +--- ld/x86_aout.h.orig 2003-01-28 22:17:14.000000000 +0000 ++++ ld/x86_aout.h +@@ -8,13 +8,8 @@ + #ifndef __AOUT_H + #define __AOUT_H + +-/* If the host isn't an x86 all bets are off, use chars. */ +-#if defined(i386) || defined(__BCC__) || defined(MSDOS) +-typedef long Long; +-#define __OUT_OK 1 +-#else +-typedef char Long[4]; +-#endif ++#include <inttypes.h> ++typedef int32_t Long; + + struct exec { /* a.out header */ + unsigned char a_magic[2]; /* magic number */ +@@ -68,16 +63,14 @@ struct exec { /* a.out header */ + #define A_HASEXT(X) ((X).a_hdrlen > (unsigned char) (A_MINHDR + 8)) + #define A_HASLNS(X) ((X).a_hdrlen > (unsigned char) (A_MINHDR + 16)) + #define A_HASTOFF(X) ((X).a_hdrlen > (unsigned char) (A_MINHDR + 24)) +-#ifdef __OUT_OK + #define A_DATAPOS(X) (A_TEXTPOS(X) + (X).a_text) + #define A_TRELPOS(X) (A_DATAPOS(X) + (X).a_data) + #define A_DRELPOS(X) (A_TRELPOS(X) + (X).a_trsize) + #define A_SYMPOS(X) (A_TRELPOS(X) + (A_HASRELS(X) ? \ + ((X).a_trsize + (X).a_drsize) : 0)) +-#endif struct reloc { - long r_vaddr; /* virtual address of reference */ diff --git a/devel/bin86/patches/patch-ld_dumps.c b/devel/bin86/patches/patch-ld_dumps.c new file mode 100644 index 00000000000..ceeab2ccf38 --- /dev/null +++ b/devel/bin86/patches/patch-ld_dumps.c @@ -0,0 +1,13 @@ +$NetBSD: patch-ld_dumps.c,v 1.1 2015/02/23 18:20:21 joerg Exp $ + +--- ld/dumps.c.orig 2015-02-22 19:51:17.000000000 +0000 ++++ ld/dumps.c +@@ -1,7 +1,7 @@ + /* dumps.c - print data about symbols and modules for linker */ + + /* Copyright (C) 1994 Bruce Evans */ +- ++#include <string.h> + #include "const.h" + #include "obj.h" + #include "type.h" diff --git a/devel/bin86/patches/patch-ld_objchop.c b/devel/bin86/patches/patch-ld_objchop.c new file mode 100644 index 00000000000..e328b1b5235 --- /dev/null +++ b/devel/bin86/patches/patch-ld_objchop.c @@ -0,0 +1,39 @@ +$NetBSD: patch-ld_objchop.c,v 1.1 2015/02/23 18:20:21 joerg Exp $ + +--- ld/objchop.c.orig 2015-02-22 19:55:07.000000000 +0000 ++++ ld/objchop.c +@@ -1,17 +1,8 @@ +- ++#include <stdint.h> + #include <stdio.h> ++#include <stdlib.h> + #include "x86_aout.h" + +-#ifndef __OUT_OK +- +-main() +-{ +- fprintf(stderr, "Compile error: struct exec invalid\n"); +- exit(1); +-} +- +-#else +- + FILE * ifd; + struct exec header; + +@@ -44,7 +35,7 @@ char ** argv; + ofd = fopen(argv[4], "w"); + if( ofd == 0 ) fatal("Cannot open output file"); + +- fprintf(ofd, "TEXT_SIZE=%ld\nDATA_SIZE=%ld\nBSS_SIZE=%ld\nALLOC_SIZE=%ld\n", ++ fprintf(ofd, "TEXT_SIZE=%"PRId32"\nDATA_SIZE=%"PRId32"\nBSS_SIZE=%"PRId32"\nALLOC_SIZE=%"PRId32"\n", + header.a_text, header.a_data, header.a_bss, header.a_total); + + fclose(ofd); +@@ -83,5 +74,3 @@ char * str; + fprintf(stderr, "objchop: %s\n", str); + exit(2); + } +- +-#endif |