util-linux-2.13-pre17-hardcode-a-out-constants.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. Hardcode a.out related constants
  2. The OMAGIC, NMAGIC and ZMAGIC constants, related to the legacy a.out
  3. binary format, are no longer available in the headers of all
  4. architectures, due to this binary format being deprecated. For that
  5. reason, util-linux fails to build.
  6. We therefore take the approach used in newer versions of
  7. util-linux-ng: hardcoding those values. See
  8. http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=commitdiff;h=e9eb4dad0ece03914f67f6d1ded74cfbbe694ba4
  9. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  10. ---
  11. text-utils/more.c | 7 +++----
  12. 1 file changed, 3 insertions(+), 4 deletions(-)
  13. Index: util-linux-2.13-pre7/text-utils/more.c
  14. ===================================================================
  15. --- util-linux-2.13-pre7.orig/text-utils/more.c
  16. +++ util-linux-2.13-pre7/text-utils/more.c
  17. @@ -53,7 +53,6 @@
  18. #include <sys/stat.h>
  19. #include <sys/file.h>
  20. #include <sys/wait.h>
  21. -#include <a.out.h>
  22. #include <locale.h>
  23. #include "xstrncpy.h"
  24. #include "nls.h"
  25. @@ -504,9 +503,9 @@
  26. if (fread(twobytes, 2, 1, f) == 1) {
  27. switch(twobytes[0] + (twobytes[1]<<8)) {
  28. - case OMAGIC: /* 0407 */
  29. - case NMAGIC: /* 0410 */
  30. - case ZMAGIC: /* 0413 */
  31. + case 0407: /* a.out obj */
  32. + case 0410: /* a.out exec */
  33. + case 0413: /* a.out demand exec */
  34. case 0405:
  35. case 0411:
  36. case 0177545: