Mercury Bugs - mercury
View Issue Details
0000524mercuryBugpublic2020-10-14 20:212020-10-16 07:16
Reporterdirkz 
Assigned Tozs 
PrioritynormalSeverityblockReproducibilityalways
StatusresolvedResolutionfixed 
PlatformMacOSmacOS CatalinaOS Version10.15.7
Product Version 
Target VersionFixed in Version 
Summary0000524: Installing rotd-2020-10-13 aborts with error
DescriptionInstalling rotd-2020-10-13 aborts with this error message:

backend_libs.bytecode_data.c:256:14: error: "Weird-endian architecture"
            #error "Weird-endian architecture"
             ^
backend_libs.bytecode_data.c:339:14: error: "Weird-endian architecture"
            #error "Weird-endian architecture"
             ^
backend_libs.bytecode_data.c:457:14: error: "Weird-endian architecture"
            #error "Weird-endian architecture"
             ^
3 errors generated.
make[2]: *** [backend_libs.bytecode_data.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [compiler] Error 2
make: *** [all] Error 2
Steps To Reproducesh configure --disable-most-grades
make PARALLEL=-j8
Additional Information$ gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin


$ llvm-gcc -v
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin


$ clang -v
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
TagsNo tags attached.
Attached Fileslog config.log (362,768) 2020-10-14 22:45
https://bugs.mercurylang.org/file_download.php?file_id=308&type=bug

Notes
(0001113)
juliensf   
2020-10-14 21:07   
Hi Dirk,

The above will only occur if the configure script cannot determine the endianness of the system.
Somewhere amongst the output of configure it should say something like:

    checking whether we can use unboxed 64-bit integers... yes
    checking whether architecture is big-endian... no
    checking whether architecture is little-endian... yes
    checking whether we can use files as locks... yes

Do both the endianness checks return "no" on your system? If so, could you please check in config.log
and see why those checks are failing? (Or post that file into Mantis and we'll take a look.)
(0001114)
juliensf   
2020-10-14 21:31   
BTW, I think the issue here is that Xcode 12 sets -Werror=implicit-function-declaration and the configure
script contains several tests (including the ones for testing endianness) that do implicitly declare functions.
(0001115)
dirkz   
2020-10-14 22:45   
Hi Julien,

both endianness checks return "no":
  checking whether we can use unboxed 64-bit integers... yes
  checking whether architecture is big-endian... no
  checking whether architecture is little-endian... no
  checking whether we can use files as locks... yes

config.log (attached) states:
configure:9044: checking whether architecture is big-endian
configure:9071: gcc -o conftest -O -Iruntime -Iruntime/machdeps -Itrace conftest.c >&5
conftest.c:146:21: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
                    exit(0);
                    ^
conftest.c:146:21: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
1 error generated.
configure:9071: $? = 1
configure: program exited with status 1
(0001116)
zs   
2020-10-14 22:55   
Julien has already committed a diff to #include stdlib.h.
It should show up in the next ROTD, or you could check it out
of github, and try it out.
(0001117)
juliensf   
2020-10-14 22:56   
Hi Dirk,

Thanks for that. The issue is the changed settings for Xcode 12; commit 00d5ede should fix the
problem. (It will be included in the next rotd.)
(0001118)
dirkz   
2020-10-15 03:22   
Hi Julien,
Hi Zoltan,

rotd-2020-10-14 builds from source successfully now.

Thank you for fixing this.
(0001122)
zs   
2020-10-16 07:16   
Fix committed 2020 oct 13.

Issue History
2020-10-14 20:21dirkzNew Issue
2020-10-14 21:07juliensfNote Added: 0001113
2020-10-14 21:31juliensfNote Added: 0001114
2020-10-14 22:45dirkzFile Added: config.log
2020-10-14 22:45dirkzNote Added: 0001115
2020-10-14 22:55zsNote Added: 0001116
2020-10-14 22:56juliensfNote Added: 0001117
2020-10-15 03:22dirkzNote Added: 0001118
2020-10-16 07:16zsAssigned To => zs
2020-10-16 07:16zsStatusnew => resolved
2020-10-16 07:16zsResolutionopen => fixed
2020-10-16 07:16zsNote Added: 0001122