Port-sparc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: README: gcc 7 switch coming to a port near you!



for some reason, the .eh_frame section is linked to the crunched
cp binary in ways i don't really understand.  i've written this
hack patch that also should help the sparc64 issue until we figure
out a better/real solution to this.

i haven't tested the installer, but rescue works again, and
i didn't test sparc64 either.


.mrg.


Index: crunchgen.c
===================================================================
RCS file: /cvsroot/src/usr.bin/crunch/crunchgen/crunchgen.c,v
retrieving revision 1.89
diff -p -u -u -r1.89 crunchgen.c
--- crunchgen.c	26 Jul 2018 08:57:32 -0000	1.89
+++ crunchgen.c	12 Feb 2019 05:51:09 -0000
@@ -961,6 +961,15 @@ top_makefile_rules(FILE *outmk)
 
     fprintf(outmk, "LDSTATIC=-static%s\n\n", pie ? " -pie" : "");
     fprintf(outmk, "PROG=%s\n\n", execfname);
+
+    fprintf(outmk, "OBJCOPY_REMOVE_FLAGS=-R .eh_frame_hdr -R .note -R .note.netbsd.pax -R .ident -R .comment -R .copyright\n\n");
+
+    fprintf(outmk, ".if ${MACHINE} != \"sparc\"\n");
+    fprintf(outmk, "OBJCOPY_REMOVE_FLAGS+=-R .eh_frame\n");
+    fprintf(outmk, ".endif\n");
+    fprintf(outmk, ".if ${MACHINE} != \"sparc64\"\n");
+    fprintf(outmk, "OBJCOPY_REMOVE_FLAGS+=-R .note.netbsd.mcmodel\n");
+    fprintf(outmk, ".endif\n\n");
     
     fprintf(outmk, "all: ${PROG}.crunched\n");
     fprintf(outmk, "${PROG}.crunched: ${SUBMAKE_TARGETS} .WAIT ${PROG}.strip\n");
@@ -969,7 +978,7 @@ top_makefile_rules(FILE *outmk)
     fprintf(outmk, "\t@[ -f ${PROG}.unstripped -a ! ${PROG} -nt ${PROG}.unstripped ] || { \\\n");
     fprintf(outmk, "\t\t${_MKSHMSG:Uecho} \"  strip \" ${PROG}; \\\n");
     fprintf(outmk, "\t\tcp ${PROG} ${PROG}.unstripped && \\\n");
-    fprintf(outmk, "\t\t${OBJCOPY} -S -R .eh_frame -R .eh_frame_hdr -R .note -R .note.netbsd.mcmodel -R .note.netbsd.pax -R .ident -R .comment -R .copyright ${PROG} && \\\n");
+    fprintf(outmk, "\t\t${OBJCOPY} -S ${OBJCOPY_REMOVE_FLAGS} ${PROG} && \\\n");
     fprintf(outmk, "\t\ttouch ${PROG}.unstripped; \\\n");
     fprintf(outmk, "\t}\n");
     fprintf(outmk, "objs: $(SUBMAKE_TARGETS)\n");


Home | Main Index | Thread Index | Old Index