summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-embedded/gputils/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-embedded/gputils/files')
-rw-r--r--dev-embedded/gputils/files/gputils-0.13.6-code_pack.patch182
-rw-r--r--dev-embedded/gputils/files/gputils-0.13.7-strncat.patch94
2 files changed, 276 insertions, 0 deletions
diff --git a/dev-embedded/gputils/files/gputils-0.13.6-code_pack.patch b/dev-embedded/gputils/files/gputils-0.13.6-code_pack.patch
new file mode 100644
index 000000000000..f743ec343f62
--- /dev/null
+++ b/dev-embedded/gputils/files/gputils-0.13.6-code_pack.patch
@@ -0,0 +1,182 @@
+Index: gpasm/lst.c
+===================================================================
+--- gpasm/lst.c (revision 541)
++++ gpasm/lst.c (revision 542)
+@@ -212,11 +212,75 @@
+ }
+ }
+
++unsigned int lst_data(char *m, unsigned int byte_org,
++ unsigned int bytes_emitted, size_t sizeof_m)
++{
++ char buf[BUFSIZ];
++ unsigned int i;
++ unsigned int lst_bytes = 0;
++
++ if ((byte_org & 1) != 0) {
++ /* not word-aligned */
++ /* list first byte */
++ unsigned char emit_byte = (unsigned char)(i_memory_get(state.i_memory,
++ (byte_org >> 1)) >> 8);
++ snprintf(buf, sizeof(buf), "%02X", emit_byte);
++ strncat(m, buf, sizeof_m);
++ ++lst_bytes;
++ /* list whole words */
++ for (i = 0; (i < ((bytes_emitted-1) >> 1)) && (i < 1); ++i) {
++ unsigned int emit_word = i_memory_get(state.i_memory,
++ ((byte_org+1) >> 1) + i) & 0xffff;
++ snprintf(buf, sizeof(buf), "%02X %02X", emit_word & 0x00ff,
++ emit_word >> 8);
++ strncat(m, buf, sizeof_m);
++ lst_bytes += 2;
++ }
++ /* list extra byte if odd */
++ if (((byte_org+bytes_emitted) & 1) != 0) {
++ snprintf(buf, sizeof(buf), "%02X ", i_memory_get(state.i_memory,
++ ((byte_org + bytes_emitted - 2) >> 1)) & 0x00ff);
++ strncat(m, buf, sizeof_m);
++ ++lst_bytes;
++ }
++ else {
++ strncat(m, " ", sizeof_m);
++ }
++ }
++ else { /* word-aligned */
++ /* list full words as bytes */
++ for (i = 0; (i < (bytes_emitted >> 1)) && (i < 2); ++i) {
++ unsigned int emit_word = i_memory_get(state.i_memory,
++ (byte_org>>1) + i) & 0xffff;
++ snprintf(buf, sizeof(buf), "%04X ", emit_word);
++ strncat(m, buf, sizeof_m);
++ lst_bytes += 2;
++ }
++ if (bytes_emitted < 4) {
++ /* list extra byte if odd */
++ if (((byte_org+bytes_emitted) & 1) != 0) {
++ snprintf(buf, sizeof(buf), "%02X ", i_memory_get(state.i_memory,
++ (byte_org+bytes_emitted)>>1) & 0x00ff);
++ strncat(m, buf, sizeof_m);
++ ++lst_bytes;
++ }
++ else {
++ strncat(m, " ", sizeof_m);
++ }
++ }
++ }
++
++ return lst_bytes;
++}
++
+ void lst_format_line(char *src_line, int value)
+ {
+ char m[BUFSIZ];
+ char buf[BUFSIZ];
+ unsigned int emitted = 0;
++ unsigned int byte_org = 0;
++ unsigned int bytes_emitted = 0;
++ unsigned int lst_bytes;
+
+ assert(src_line != NULL);
+
+@@ -239,41 +303,21 @@
+ state.device.id_location + 1) & 0xffff);
+ break;
+ case insn:
+- emitted = state.org - state.lst.line.was_org
+- + (state.obj.section &&
+- state.obj.section->emitted_pack_byte ? 1 : 0);
+- snprintf(m, sizeof(m), "%04X ", (state.lst.line.was_org << _16bit_core)
+- - (state.obj.section &&
+- ((emitted == 0 &&
+- state.obj.section->have_pack_byte) ||
+- state.obj.section->emitted_pack_byte) ? 1 : 0));
++ byte_org = (state.lst.line.was_org << 1);
++ if (state.obj.section)
++ byte_org -= (state.obj.section->emitted_pack_byte ? 1 : 0);
++ bytes_emitted = (state.org << 1) - byte_org;
++ if (state.obj.section)
++ bytes_emitted -= (state.obj.section->have_pack_byte ? 1 : 0);
++ emitted = (bytes_emitted >> 1);
++ if (((byte_org & 1) == 0) && ((bytes_emitted & 1) != 0))
++ emitted += 1;
++ snprintf(m, sizeof(m), "%04X ", byte_org >> (1 - _16bit_core));
+
+- if (emitted >= 1) {
+- if(state.obj.section && state.obj.section->have_pack_byte && emitted == 1)
+- snprintf(buf, sizeof(buf), "%02X ", i_memory_get(state.i_memory, state.lst.line.was_org) & 0xff);
+- else if(state.obj.section && state.obj.section->emitted_pack_byte)
+- snprintf(buf, sizeof(buf), " %02X ", (i_memory_get(state.i_memory, state.lst.line.was_org - 1) & 0xff00) >> 8);
+- else
+- snprintf(buf, sizeof(buf), "%04X ", i_memory_get(state.i_memory,
+- state.lst.line.was_org) & 0xffff);
++ lst_bytes = lst_data(m, byte_org, bytes_emitted, sizeof(m));
++ byte_org += lst_bytes;
++ bytes_emitted -= lst_bytes;
+
+- strncat(m, buf, sizeof(m));
+- } else
+- strncat(m, " ", sizeof(m));
+-
+- if (emitted >= 2) {
+- if(state.obj.section && state.obj.section->have_pack_byte && emitted == 2)
+- snprintf(buf, sizeof(buf), "%02X ", i_memory_get(state.i_memory,
+- state.lst.line.was_org
+- + (state.obj.section->emitted_pack_byte ? 0 : 1)) & 0xffff);
+- else
+- snprintf(buf, sizeof(buf), "%04X ", i_memory_get(state.i_memory,
+- state.lst.line.was_org
+- + (state.obj.section &&
+- state.obj.section->emitted_pack_byte ? 0 : 1)) & 0xffff);
+- strncat(m, buf, sizeof(buf));
+- } else
+- strncat(m, " ", sizeof(m));
+ break;
+ case config:
+ if(_16bit_core) {
+@@ -376,39 +420,16 @@
+ lst_line(m);
+ }
+
+- if (emitted > 2) {
+- int i;
++ if (bytes_emitted > 0) {
++ while (bytes_emitted > 0) {
++ /* data left to print on separate lines */
+
+- for (i = 2; i < emitted; i += 2) {
+- unsigned int org = state.lst.line.was_org + i -
+- (state.obj.section && state.obj.section->emitted_pack_byte ? 1 : 0);
+-
+- if ((i + 1) < emitted)
+- if(state.obj.section && state.obj.section->have_pack_byte)
+- snprintf(m, sizeof(m), "%04X %04X %02X ",
+- org << _16bit_core,
+- i_memory_get(state.i_memory, org) & 0xffff,
+- i_memory_get(state.i_memory, org + 1) & 0xff);
+- else
+- snprintf(m, sizeof(m), "%04X %04X %04X",
+- org << _16bit_core,
+- i_memory_get(state.i_memory, org) & 0xffff,
+- i_memory_get(state.i_memory, org + 1) & 0xffff);
+- else {
+- if(state.obj.section && state.obj.section->have_pack_byte)
+- snprintf(m, sizeof(m), "%04X %02X ",
+- ((state.lst.line.was_org + i) << _16bit_core),
+- i_memory_get(state.i_memory,
+- state.lst.line.was_org + i) & 0xff);
+- else
+- snprintf(m, sizeof(m), "%04X %04X",
+- ((state.lst.line.was_org + i) << _16bit_core),
+- i_memory_get(state.i_memory,
+- state.lst.line.was_org + i) & 0xffff);
+- }
++ strncpy(m, " ", sizeof(m));
++ lst_bytes = lst_data(m, byte_org, bytes_emitted, sizeof(m));
++ byte_org += lst_bytes;
++ bytes_emitted -= lst_bytes;
+ lst_line(m);
+ }
+-
+ state.cod.emitting = 0;
+ }
+
diff --git a/dev-embedded/gputils/files/gputils-0.13.7-strncat.patch b/dev-embedded/gputils/files/gputils-0.13.7-strncat.patch
new file mode 100644
index 000000000000..577a4bf0328f
--- /dev/null
+++ b/dev-embedded/gputils/files/gputils-0.13.7-strncat.patch
@@ -0,0 +1,94 @@
+https://sourceforge.net/tracker/?func=detail&aid=3081197&group_id=41924&atid=431665
+https://sourceforge.net/tracker/?func=detail&aid=3081206&group_id=41924&atid=431665
+
+--- a/gpasm/scan.c
++++ b/gpasm/scan.c
+@@ -461,9 +461,7 @@ search_pathes(struct source_context *new, char *name)
+ int i;
+
+ for(i = 0; i < state.path_num; i++) {
+- strncpy(tryname, state.paths[i], sizeof(tryname));
+- strncat(tryname, COPY_CHAR, sizeof(tryname));
+- strncat(tryname, name, sizeof(tryname));
++ snprintf(tryname, sizeof(tryname), "%s%s%s", state.paths[i], COPY_CHAR, name);
+ new->f = fopen(tryname, "rt");
+ if(new->f) {
+ new->name = strdup(tryname);
+--- a/gplink/gplink.c
++++ b/gplink/gplink.c
+@@ -340,9 +340,7 @@ void gplink_open_coff(char *name)
+ int i;
+
+ for(i = 0; i < state.numpaths; i++) {
+- strncpy(file_name, state.paths[i], sizeof(file_name));
+- strncat(file_name, COPY_CHAR, sizeof(file_name));
+- strncat(file_name, name, sizeof(file_name));
++ snprintf(file_name, sizeof(file_name), "%s%s%s", state.paths[i], COPY_CHAR, name);
+ coff = fopen(file_name, "rb");
+ if (coff != NULL) {
+ break;
+@@ -695,9 +693,7 @@ linker(void)
+ gp_error("linker script not specified and can't determine default script");
+ return EXIT_FAILURE;
+ }
+- strncpy(file_name, gp_lkr_path, sizeof(file_name));
+- strncat(file_name, COPY_CHAR, sizeof(file_name));
+- strncat(file_name, script_name, sizeof(file_name));
++ snprintf(file_name, sizeof(file_name), "%s%s%s", gp_lkr_path, COPY_CHAR, script_name);
+ gp_message("using default linker script \"%s\"", file_name);
+ open_src(file_name, 0);
+ yyparse();
+--- a/gplink/scan.c
++++ b/gplink/scan.c
+@@ -115,9 +115,7 @@ void open_src(char *name, int isinclude)
+ int i;
+
+ for(i = 0; i < state.numpaths; i++) {
+- strncpy(tryname, state.paths[i], sizeof(tryname));
+- strncat(tryname, COPY_CHAR, sizeof(tryname));
+- strncat(tryname, name, sizeof(tryname));
++ snprintf(tryname, sizeof(tryname), "%s%s%s", state.paths[i], COPY_CHAR, name);
+ new->f = fopen(tryname, "rt");
+ if(new->f) {
+ new->name = strdup(tryname);
+--- a/gpasm/lst.c
++++ b/gpasm/lst.c
+@@ -149,22 +149,23 @@ void lst_memory_map(MemBlock *m)
+ }
+
+ if(row_used) {
+- snprintf(buf, sizeof(buf), "%08x :", (i + base) << _16bit_core);
++ int len = sizeof(buf);
++ len -= snprintf(buf, len, "%08x :", (i + base) << _16bit_core);
+ for (j = 0; j < num_per_line; j++) {
+ if ((j % num_per_block) == 0) {
+- strncat(buf, " ", sizeof(buf));
++ strncat(buf, " ", len--);
+ }
+ if (m->memory[i + j] & MEM_USED_MASK) {
+- strncat(buf, "X", sizeof(buf));
++ strncat(buf, "X", len--);
+ if (_16bit_core) {
+ /* each word has two bytes */
+- strncat(buf, "X", sizeof(buf));
++ strncat(buf, "X", len--);
+ }
+ } else {
+- strncat(buf, "-", sizeof(buf));
++ strncat(buf, "-", len--);
+ if (_16bit_core) {
+ /* each word has two bytes */
+- strncat(buf, "-", sizeof(buf));
++ strncat(buf, "-", len--);
+ }
+ }
+ }
+@@ -404,7 +405,7 @@ void lst_format_line(char *src_line, int value)
+ } else {
+ snprintf(buf, sizeof(buf), " M ");
+ }
+- strncat(m, buf, sizeof(m));
++ strncat(m, buf, sizeof(m) - strlen(m));
+
+ /* Now copy 'l' to 'e', expanding tabs as required */
+ {