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.

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

mercurial