Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build failed on cygwin #93

Closed
fd00 opened this issue Feb 11, 2019 · 9 comments
Closed

build failed on cygwin #93

fd00 opened this issue Feb 11, 2019 · 9 comments
Labels
bug Something isn't working

Comments

@fd00
Copy link

fd00 commented Feb 11, 2019

(サポート予定があるかどうかわからないですが) cygwin 環境でのビルドができない状態です。

ログ : https://gist.github.com/fd00/f589f0c42f3677117d9fc3e8f43474e2

  • resolve 以外のエラーは -D_GNU_SOURCE で解決します。
  • resolve は引数 port の型がきちんと解釈できていないように見えるのですが cygwin gcc 特有のものかはわからないです...。

環境

$ /usr/bin/c++ -v
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with: /cygdrive/i/szsz/tmpp/gcc/gcc-7.4.0-1.x86_64/src/gcc-7.4.0/configure --srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-7.4.0-1.x86_64/src/gcc-7.4.0 --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C --build=x86_64-pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --libexecdir=/usr/lib --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_atexit --with-dwarf2 --with-tune=generic --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-graphite --enable-threads=posix --enable-libatomic --enable-libcilkrts --enable-libgomp --enable-libitm --enable-libquadmath --enable-libquadmath-support --disable-libssp --enable-libada --disable-symvers --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible --enable-libstdcxx-filesystem-ts
Thread model: posix
gcc version 7.4.0 (GCC) 
@ken-matsui
Copy link
Member

ありがとうございます!サポート予定です!
boostのバージョンを教えていただけますか?

@ken-matsui ken-matsui added the bug Something isn't working label Feb 11, 2019
@fd00
Copy link
Author

fd00 commented Feb 11, 2019

1.66.0 です。

$ cygcheck -cd | grep libboost
libboost-devel                       1.66.0-1
libboost_atomic1.66                  1.66.0-1
libboost_chrono1.66                  1.66.0-1
libboost_container1.66               1.66.0-1
libboost_context1.66                 1.66.0-1
libboost_coroutine1.66               1.66.0-1
libboost_date_time1.66               1.66.0-1
libboost_filesystem1.66              1.66.0-1
libboost_graph1.66                   1.66.0-1
libboost_graph_parallel1.66          1.66.0-1
libboost_iostreams1.66               1.66.0-1
libboost_locale1.66                  1.66.0-1
libboost_log1.66                     1.66.0-1
libboost_math1.66                    1.66.0-1
libboost_mpi1.66                     1.66.0-1
libboost_mpi_python1.66              1.66.0-1
libboost_mpi_python3_1.66            1.66.0-1
libboost_numpy1.66                   1.66.0-1
libboost_numpy3_1.66                 1.66.0-1
libboost_program_options1.66         1.66.0-1
libboost_python1.66                  1.66.0-1
libboost_python3-devel               1.66.0-1
libboost_python3_1.66                1.66.0-1
libboost_random1.66                  1.66.0-1
libboost_regex1.66                   1.66.0-1
libboost_serialization1.66           1.66.0-1
libboost_signals1.66                 1.66.0-1
libboost_stacktrace1.66              1.66.0-1
libboost_system1.64                  1.64.0-1
libboost_system1.66                  1.66.0-1
libboost_test1.66                    1.66.0-1
libboost_thread1.66                  1.66.0-1
libboost_timer1.66                   1.66.0-1
libboost_type_erasure1.66            1.66.0-1
libboost_wave1.66                    1.66.0-1

@ken-matsui
Copy link
Member

もしかしたらboost-1.66.0だと上手くビルドできない可能性があります...
(ドキュメントにboost-1.66.0以上とは書いていましたが検証してないので)
今は時間を回せないのですが時間ができたら検証してみます.
原因が分かり次第連絡させて頂きます.
よろしくお願いします.

@wx257osn2
Copy link
Contributor

Boost.Asioの string_view の存在判定がなんかバグってるので(原因は深く調査してません),マクロ定義でオーバーライドしてあげればコンパイル自体は通ります.

$ cmake .. -DCMAKE_CXX_FLAGS="-D_GNU_SOURCE -DBOOST_ASIO_HAS_STD_STRING_VIEW"
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++.exe
-- Check for working CXX compiler: /usr/bin/c++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test COMPILER_SUPPORTS_CXX17
-- Performing Test COMPILER_SUPPORTS_CXX17 - Success
-- Performing Test COMPILER_SUPPORTS_CXX1z
-- Performing Test COMPILER_SUPPORTS_CXX1z - Success
-- CXX_FLAG: -std=c++17
-- Configuring done
-- Generating done
-- Build files have been written to: /path/to/poac/build

$ make
[ 50%] Building CXX object CMakeFiles/poac.dir/main.cpp.o
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/../../../../x86_64-pc-cygwin/bin/as: CMakeFiles/poac.dir/main.cpp.o: too many sections (37148)
/tmp/ccAWZvf2.s: Assembler messages:
/tmp/ccAWZvf2.s: Fatal error: can't write 171 bytes to section .text of CMakeFiles/poac.dir/main.cpp.o because: 'File too big'
/usr/lib/gcc/x86_64-pc-cygwin/7.4.0/../../../../x86_64-pc-cygwin/bin/as: CMakeFiles/poac.dir/main.cpp.o: too many sections (37148)
/tmp/ccAWZvf2.s: Fatal error: can't close CMakeFiles/poac.dir/main.cpp.o: File too big
make[2]: *** [CMakeFiles/poac.dir/build.make:63: CMakeFiles/poac.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/poac.dir/all] Error 2
make: *** [Makefile:128: all] Error 2

(リンクが通るとは言ってない)

@ken-matsui
Copy link
Member

おお.ありがとうございます.
そのリンクエラーはコンパイル時の展開が大きいのが問題っぽいですね.
assimp/assimp#2067

cmakeに-bigobjフラグをつけるとリンクが上手くいくかもしれないです.

@wx257osn2
Copy link
Contributor

とりあえず cmake .. -DCMAKE_CXX_FLAGS="-D_GNU_SOURCE -DBOOST_ASIO_HAS_STD_STRING_VIEW -Wa,-mbig-obj" でビルドが通ること/オプション無しの実行でヘルプが出ることまで確認できました.

@fd00
Copy link
Author

fd00 commented Feb 16, 2019

[FYI] patch なしでビルドできるようになったのでパッケージスクリプトを作成してみました。

@ken-matsui
Copy link
Member

ありがとうございます!

@ken-matsui
Copy link
Member

ビルドできるようになったと思うのでcloseします

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants