stsp / dj64dev

dj64dev development suite
https://github.com/stsp/dj64dev/
GNU Lesser General Public License v3.0
6 stars 1 forks source link

Build is failing on Arch Linux #18

Closed morgan-greywolf closed 1 month ago

morgan-greywolf commented 1 month ago

   14 | extern float __dj_float_max;
      |              ^
../ansif/float/float_fx.c:4:9: note: type ‘struct float_t’ should match type ‘float’
    4 | float_t __dj_float_max     = { 0x7fffff, 0xfe, 0x0 };
      |         ^
../ansif/float/float_fx.c:4:9: note: ‘__dj_float_max’ was previously declared here
../ansif/float/float_fx.c:4:9: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../ansi/stdlib/../../../../include/math.h:100:20: error: type of ‘__dj_huge_vall’ does not match original declaration [-Werror=lto-type-mismatch]
  100 | extern long double __dj_huge_vall;
      |                    ^
../c99/math/hugevall.c:6:15: note: type ‘struct long_double_t’ should match type ‘long double’
    6 | long_double_t __dj_huge_vall = { 0x00000000, 0x80000000, 0x7fff, 0x0 };
      |               ^
../c99/math/hugevall.c:6:15: note: ‘__dj_huge_vall’ was previously declared here
../c99/math/hugevall.c:6:15: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../ansi/stdlib/../../../../include/float.h:30:15: error: type of ‘__dj_double_max’ does not match original declaration [-Werror=lto-type-mismatch]
   30 | extern double __dj_double_max;
      |               ^
../ansif/float/float_dx.c:4:10: note: type ‘struct double_t’ should match type ‘double’
    4 | double_t __dj_double_max     = { 0xffffffffU, 0xfffff, 0x7fe, 0x0 };
      |          ^
../ansif/float/float_dx.c:4:10: note: ‘__dj_double_max’ was previously declared here
../ansif/float/float_dx.c:4:10: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../ansi/stdlib/../../../../include/math.h:107:14: error: type of ‘__dj_nan’ does not match original declaration [-Werror=lto-type-mismatch]
  107 | extern float       __dj_nan;
      |              ^
../c99/math/nan_def.c:4:9: note: type ‘struct float_t’ should match type ‘float’
    4 | float_t __dj_nan = { 0x7fffff, 0xff, 0x0 };
      |         ^
../c99/math/nan_def.c:4:9: note: ‘__dj_nan’ was previously declared here
../c99/math/nan_def.c:4:9: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../ansi/stdlib/../../../../include/math.h:99:14: error: type of ‘__dj_huge_valf’ does not match original declaration [-Werror=lto-type-mismatch]
   99 | extern float       __dj_huge_valf;
      |              ^
../c99/math/hugevalf.c:4:9: note: type ‘struct float_t’ should match type ‘float’
    4 | float_t __dj_huge_valf = { 0x00000, 0xff, 0x0 };
      |         ^
../c99/math/hugevalf.c:4:9: note: ‘__dj_huge_valf’ was previously declared here
../c99/math/hugevalf.c:4:9: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
../ansi/stdlib/../../../../include/math.h:22:15: error: type of ‘__dj_huge_val’ does not match original declaration [-Werror=lto-type-mismatch]
   22 | extern double __dj_huge_val;
      |               ^
../ansi/math/huge_val.c:4:10: note: type ‘struct double_t’ should match type ‘double’
    4 | double_t __dj_huge_val = { 0x00000, 0x00000, 0x7ff, 0x0 };
      |          ^
../ansi/math/huge_val.c:4:10: note: ‘__dj_huge_val’ was previously declared here
../ansi/math/huge_val.c:4:10: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
lto1: all warnings being treated as errors
lto-wrapper: fatal error: cc returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[3]: *** [makefile:65: ../../../lib/libdj64.so.0.2] Error 1
make[3]: Leaving directory '/home/rshinn/.cache/paru/clone/dj64-git/src/dj64dev/src/libc/dj64'
make[2]: *** [../makefile.lib:9: all] Error 2
make[2]: Leaving directory '/home/rshinn/.cache/paru/clone/dj64-git/src/dj64dev/src/libc'
make[1]: *** [makefile:7: subs] Error 2
make[1]: Leaving directory '/home/rshinn/.cache/paru/clone/dj64-git/src/dj64dev/src'
make: *** [makefile:59: subs] Error 2```

when issuing `make -j1`
morgan-greywolf commented 1 month ago

I find that I can work around the issue by issuing CFLAGS=-Wno-lto-type-mismatch make -j1 instead of make -j1 in the source folder.

stsp commented 1 month ago

Thanks. I don't think you have to add any options. I'll make the fix.

stsp commented 1 month ago

But thanks for info: that helps me figure I need -flto to reproduce.

stsp commented 1 month ago

Should now be fixed.

morgan-greywolf commented 1 month ago

Confirmed as working.