matrix-construct / construct

This is The Construct
Other
361 stars 43 forks source link

Cannot compile on Alpine or OpenSUSE #180

Closed jobukkit closed 2 years ago

jobukkit commented 3 years ago

Am I missing a package, or is Construct incompatible with Alpine?

configure:24142: error: in `/home/construct/Downloads/construct':
configure:24144: error: cannot compute sizeof (char16_t)
See `config.log' for more details

Relevant part of config.log (I think?):

configure:24133: checking size of char16_t
configure:24138: g++ -std=gnu++17 -o conftest -mtune=native -march=native -mno-sse4a -fno-threadsafe-statics -fvisibility-inlines-hid>
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: warning: -z text-unlikely-segment ignored
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: unrecognized option '--rosegment'
/usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
configure:24138: $? = 1
configure: program exited with status 1
jevolk commented 3 years ago

Am I missing a package,

It seems that the issue is with the linker and not char16_t. I think you might be missing the gold linker package. Check for ld.gold.

jobukkit commented 3 years ago

I installed binutils-gold but that didn't fix it.

jevolk commented 3 years ago

The above log doesn't show any symbol or compilation error for char16_t, but instead gives an error for --rosegment to ld. I recognized this a gold feature. If you have installed gold now could you perhaps try to clear the config cache (i.e git clean -f -x -d) and re-run configure and post a new log?

If the log is exactly the same, the issue appears to be gold not being found and used. AFAICT ./configure searches for ld.gold and if the Alpine package installs it under a name other than ld.gold please let me know.

jobukkit commented 3 years ago

On OpenSUSE Leap 15.2 I got

checking for library containing __dynamic_cast... no
configure: error: Please install libstdc++ on this system.

even though libstdc++6 was installed.

On Ubuntu 20.04, ./configure works but during make install I got

make[2]: Entering directory '/home/construct/Downloads/construct/ircd'
depbase=`echo fmt.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ../libtool  --tag=CXX   --mode=compile clang++ -std=gnu++17 -DHAVE_CONFIG_H -DIRCD_UNIT    -I/usr/include -include ircd/spirit.h -I../include -include ircd/ircd.pic.h   -Wall -Wextra -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Wwrite-strings -Wparentheses -Wundef -Wpacked -Wformat -Wformat-y2k -Wformat-nonliteral -Wstrict-aliasing=2 -Wstrict-overflow=5 -Wdisabled-optimization -Winvalid-pch -Winit-self -Wuninitialized -Wunreachable-code -Wno-overloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wsign-promo -Wnull-dereference -Wundef -Wodr -Werror=return-type -Wno-missing-field-initializers -Wno-unused -Wno-unused-function -Wno-unused-label -Wno-unused-value -Wno-unused-variable -Wno-unused-parameter -Wno-endif-labels -Wno-unknown-pragmas -Wno-unknown-attributes -Wno-profile-instr-unprofiled -Wno-mismatched-tags -Wno-format-security -Wno-unknown-warning-option  -DPCH -DNDEBUG   -ftls-model=initial-exec -fno-c++-static-destructors -flto=thin -fstrict-vtable-pointers -fwhole-program-vtables -fprofile-use  -fsigned-char -mtune=native -march=native -mno-sse4a -fno-threadsafe-statics -fvisibility-inlines-hidden -fasynchronous-unwind-tables -grecord-gcc-switches -ggdb -g -fno-function-sections -fno-data-sections -O3 -pipe    -MT fmt.lo -MD -MP -MF $depbase.Tpo -c -o fmt.lo fmt.cc &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  clang++ -std=gnu++17 -DHAVE_CONFIG_H -DIRCD_UNIT -I/usr/include -include ircd/spirit.h -I../include -include ircd/ircd.pic.h -Wall -Wextra -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Wwrite-strings -Wparentheses -Wundef -Wpacked -Wformat -Wformat-y2k -Wformat-nonliteral -Wstrict-aliasing=2 -Wstrict-overflow=5 -Wdisabled-optimization -Winvalid-pch -Winit-self -Wuninitialized -Wunreachable-code -Wno-overloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wsign-promo -Wnull-dereference -Wundef -Wodr -Werror=return-type -Wno-missing-field-initializers -Wno-unused -Wno-unused-function -Wno-unused-label -Wno-unused-value -Wno-unused-variable -Wno-unused-parameter -Wno-endif-labels -Wno-unknown-pragmas -Wno-unknown-attributes -Wno-profile-instr-unprofiled -Wno-mismatched-tags -Wno-format-security -Wno-unknown-warning-option -DPCH -DNDEBUG -ftls-model=initial-exec -fno-c++-static-destructors -flto=thin -fstrict-vtable-pointers -fwhole-program-vtables -fprofile-use -fsigned-char -mtune=native -march=native -mno-sse4a -fno-threadsafe-statics -fvisibility-inlines-hidden -fasynchronous-unwind-tables -grecord-gcc-switches -ggdb -g -fno-function-sections -fno-data-sections -O3 -pipe -MT fmt.lo -MD -MP -MF .deps/fmt.Tpo -c fmt.cc  -fPIC -DPIC -o .libs/fmt.o
../libtool: line 1762: 19824 Killed                  clang++ -std=gnu++17 -DHAVE_CONFIG_H -DIRCD_UNIT -I/usr/include -include ircd/spirit.h -I../include -include ircd/ircd.pic.h -Wall -Wextra -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Wwrite-strings -Wparentheses -Wundef -Wpacked -Wformat -Wformat-y2k -Wformat-nonliteral -Wstrict-aliasing=2 -Wstrict-overflow=5 -Wdisabled-optimization -Winvalid-pch -Winit-self -Wuninitialized -Wunreachable-code -Wno-overloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wsign-promo -Wnull-dereference -Wundef -Wodr -Werror=return-type -Wno-missing-field-initializers -Wno-unused -Wno-unused-function -Wno-unused-label -Wno-unused-value -Wno-unused-variable -Wno-unused-parameter -Wno-endif-labels -Wno-unknown-pragmas -Wno-unknown-attributes -Wno-profile-instr-unprofiled -Wno-mismatched-tags -Wno-format-security -Wno-unknown-warning-option -DPCH -DNDEBUG -ftls-model=initial-exec -fno-c++-static-destructors -flto=thin -fstrict-vtable-pointers -fwhole-program-vtables -fprofile-use -fsigned-char -mtune=native -march=native -mno-sse4a -fno-threadsafe-statics -fvisibility-inlines-hidden -fasynchronous-unwind-tables -grecord-gcc-switches -ggdb -g -fno-function-sections -fno-data-sections -O3 -pipe -MT fmt.lo -MD -MP -MF .deps/fmt.Tpo -c fmt.cc -fPIC -DPIC -o .libs/fmt.o
make[2]: *** [Makefile:882: fmt.lo] Error 1
make[2]: Leaving directory '/home/construct/Downloads/construct/ircd'
make[1]: *** [Makefile:989: install] Error 2
make[1]: Leaving directory '/home/construct/Downloads/construct/ircd'
make: *** [Makefile:530: install-recursive] Error 1

What am I doing wrong 😣

jevolk commented 3 years ago

Ubuntu 20.04

This one is easy, you'll just need more RAM to compile some of these units with complex grammars. It should be sufficient with 2 GiB per unit (per core) but in certain circumstances that's close to the edge and parts of the system might swap; so slightly more than 2 GiB may be required for a system which compiles (swap included).

OpenSUSE Leap 15.2

This one I'm not sure...

jobukkit commented 3 years ago

This one is easy, you'll just need more RAM to compile some of these units with complex grammars. It should be sufficient with 2 GiB per unit (per core) but in certain circumstances that's close to the edge and parts of the system might swap; so slightly more than 2 GiB may be required for a system which compiles (swap included).

Thanks, I added a 2 GB large swap file, and now I have it working on Ubuntu! Keeping this issue open for Alpine and OpenSUSE problems.

sirrkitt commented 3 years ago

On Alpine, at least, if you rename ld to something else and then symlink ld.gold to ld you can get around the issue.

mv /usr/bin/ld /usr/bin/ld.bak ln -s /usr/bin/ld.gold /usr/bin/ld mv /usr/x86_64-alpine-linux-musl/bin/ld /usr/x86_64-alpine-linux-musl/bin/ld.bak ln -s /usr/x86_64-alpine-linux-musl/bin/ld.gold /usr/x86_64-alpine-linux-musl/bin/ld

But it looks like it doesn't like musl because I get compile errors with both gcc and clang when trying to build with Alpine.

jevolk commented 3 years ago

I get compile errors with both gcc and clang when trying to build with Alpine.

You can paste the error here if it fits, otherwise feel free to pastebin the full build log.

sirrkitt commented 3 years ago

Here you go! The errors that I'm getting are at the end


        return string(e.code());
                       ^
../include/ircd/exception.h:19:9: note: forward declaration of 'boost::system::system_error'
        struct system_error;
               ^
exception.cc:84:22: error: member access into incomplete type 'const boost::system::system_error'
        return string(buf, e.code());
                            ^
../include/ircd/exception.h:19:9: note: forward declaration of 'boost::system::system_error'
        struct system_error;
               ^
exception.cc:147:30: error: no member named 'system_category' in namespace 'boost::system'
               ec == boost::system::system_category() ||
                     ~~~~~~~~~~~~~~~^
exception.cc:148:30: error: no member named 'generic_category' in namespace 'boost::system'
               ec == boost::system::generic_category();
                     ~~~~~~~~~~~~~~~^
exception.cc:156:20: error: member access into incomplete type 'const boost::system::system_error'
                make_error_code(e.code()), e.what()
                                 ^
../include/ircd/exception.h:19:9: note: forward declaration of 'boost::system::system_error'
        struct system_error;
               ^
exception.cc:156:31: error: member access into incomplete type 'const boost::system::system_error'
                make_error_code(e.code()), e.what()
                                            ^
../include/ircd/exception.h:19:9: note: forward declaration of 'boost::system::system_error'
        struct system_error;
               ^
exception.cc:202:4: error: member access into incomplete type 'const boost::system::system_error'
                e.code().value(), e.code().category()
                 ^
../include/ircd/exception.h:19:9: note: forward declaration of 'boost::system::system_error'
        struct system_error;
               ^
exception.cc:212:5: error: member access into incomplete type 'const boost::system::error_code'
                ec.value(), ec.category()
                  ^
../include/ircd/exception.h:17:9: note: forward declaration of 'boost::system::error_code'
        struct error_code;
               ^```
jevolk commented 2 years ago

Fixed by 0.7.704