cryptbreaker/cryptbreaker.patch

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
permissions
-rw-r--r--

Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.

The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.

It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.

michael@61 1 Index: terminal.c
michael@61 2 --- terminal.c.orig 1988-11-26 01:40:43.000000000 +0100
michael@61 3 +++ terminal.c 2009-01-09 18:15:47.583499911 +0100
michael@61 4 @@ -6,11 +6,11 @@
michael@61 5 /*
michael@61 6 * Routines in terminal abstraction:
michael@61 7 *
michael@61 8 - * set_term()
michael@61 9 + * set_cb_term()
michael@61 10 * Initialize terminal, clear the screen.
michael@61 11 *
michael@61 12 - * unset_term()
michael@61 13 - * Return terminal to state before set_term().
michael@61 14 + * unset_cb_term()
michael@61 15 + * Return terminal to state before set_cb_term().
michael@61 16 *
michael@61 17 * char2sym(char)
michael@61 18 * Return the symbol used to display the given char in the
michael@61 19 @@ -97,6 +97,14 @@
michael@61 20 */
michael@61 21
michael@61 22
michael@61 23 +#include <stdio.h>
michael@61 24 +#include <stdlib.h>
michael@61 25 +#include <termios.h>
michael@61 26 +#if (defined(sun) && defined(__svr4__))
michael@61 27 +#include <sys/ttold.h>
michael@61 28 +#else
michael@61 29 +#include <sys/ioctl.h>
michael@61 30 +#endif
michael@61 31 #include <curses.h>
michael@61 32 #include <sgtty.h>
michael@61 33 #include <strings.h>
michael@61 34 @@ -216,7 +224,7 @@
michael@61 35 * and termcap subroutine packages, although the old code is used
michael@61 36 * for screen refresh.
michael@61 37 */
michael@61 38 -set_term()
michael@61 39 +set_cb_term()
michael@61 40 {
michael@61 41 printf("\n\nInitializing terminal ...");
michael@61 42 fflush(stdout);
michael@61 43 @@ -609,7 +617,7 @@
michael@61 44
michael@61 45 /* Restore the terminal to its original mode.
michael@61 46 */
michael@61 47 -unset_term()
michael@61 48 +unset_cb_term()
michael@61 49 {
michael@61 50 enter_mode(SMNORMAL);
michael@61 51 Puts(end_kp); /* Can't tell if this is original. */
michael@61 52 Index: tritab.c
michael@61 53 --- tritab.c.orig 1988-11-26 01:39:37.000000000 +0100
michael@61 54 +++ tritab.c 2009-01-09 17:44:48.411457903 +0100
michael@61 55 @@ -4,6 +4,7 @@
michael@61 56
michael@61 57 #include <math.h>
michael@61 58 #include <stdio.h>
michael@61 59 +#include <stdlib.h>
michael@61 60 #include "window.h"
michael@61 61 #include "specs.h"
michael@61 62 #include "cipher.h"
michael@61 63 Index: cipher.c
michael@61 64 --- cipher.c.orig 1988-11-26 01:40:22.000000000 +0100
michael@61 65 +++ cipher.c 2009-01-09 17:54:12.811182642 +0100
michael@61 66 @@ -6,6 +6,7 @@
michael@61 67
michael@61 68
michael@61 69 #include <stdio.h>
michael@61 70 +#include <stdlib.h>
michael@61 71 #include <math.h>
michael@61 72 #include "window.h"
michael@61 73 #include "specs.h"
michael@61 74 Index: start.c
michael@61 75 --- start.c.orig 1988-11-26 01:39:45.000000000 +0100
michael@61 76 +++ start.c 2009-01-09 18:05:43.601774154 +0100
michael@61 77 @@ -11,6 +11,7 @@
michael@61 78
michael@61 79
michael@61 80 #include <stdio.h>
michael@61 81 +#include <stdlib.h>
michael@61 82 #include <signal.h>
michael@61 83 #include <setjmp.h>
michael@61 84 #include "window.h"
michael@61 85 @@ -109,13 +110,13 @@
michael@61 86 {
michael@61 87 setcursor(MAXHEIGHT, 1);
michael@61 88 fflush(stdout);
michael@61 89 - unset_term();
michael@61 90 + unset_cb_term();
michael@61 91
michael@61 92 kill(getpid(), SIGSTOP);
michael@61 93
michael@61 94 /* Return here when/if program restarted. */
michael@61 95 /* Note that the signal mask is restored by longjmp. */
michael@61 96 - set_term();
michael@61 97 + set_cb_term();
michael@61 98 longjmp(saved_stack, 0);
michael@61 99 }
michael@61 100
michael@61 101 @@ -128,7 +129,7 @@
michael@61 102 setcursor(MAXHEIGHT, 1);
michael@61 103 printf("\n");
michael@61 104 fflush(stdout);
michael@61 105 - unset_term();
michael@61 106 + unset_cb_term();
michael@61 107
michael@61 108 kill(getpid(), SIGKILL);
michael@61 109 }
michael@61 110 @@ -192,7 +193,7 @@
michael@61 111 done(status)
michael@61 112 int status;
michael@61 113 {
michael@61 114 - unset_term();
michael@61 115 + unset_cb_term();
michael@61 116 printf("\n");
michael@61 117 exit(status);
michael@61 118 }
michael@61 119 Index: stats.c
michael@61 120 --- stats.c.orig 1988-11-26 01:40:42.000000000 +0100
michael@61 121 +++ stats.c 2009-01-09 17:54:22.235822458 +0100
michael@61 122 @@ -7,6 +7,7 @@
michael@61 123
michael@61 124
michael@61 125 #include <stdio.h>
michael@61 126 +#include <stdlib.h>
michael@61 127 #include <math.h>
michael@61 128 #include "window.h"
michael@61 129 #include "specs.h"
michael@61 130 Index: cdblocks.c
michael@61 131 --- cblocks.c.orig 1988-11-26 01:39:27.000000000 +0100
michael@61 132 +++ cblocks.c 2009-01-09 17:58:13.630695396 +0100
michael@61 133 @@ -10,6 +10,7 @@
michael@61 134
michael@61 135
michael@61 136 #include <stdio.h>
michael@61 137 +#include <stdlib.h>
michael@61 138 #include "window.h"
michael@61 139 #include "layout.h"
michael@61 140 #include "specs.h"
michael@61 141 Index: perm.c
michael@61 142 --- perm.c.orig 1988-11-26 01:39:44.000000000 +0100
michael@61 143 +++ perm.c 2009-01-09 17:58:19.870669485 +0100
michael@61 144 @@ -7,6 +7,7 @@
michael@61 145
michael@61 146
michael@61 147 #include <stdio.h>
michael@61 148 +#include <stdlib.h>
michael@61 149 #include "window.h"
michael@61 150 #include "specs.h"
michael@61 151

mercurial