-
Notifications
You must be signed in to change notification settings - Fork 22
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
GCC < 9 incompatibility #17
Comments
This is a tricky problem.
There's no other way than std::filesystem::resize_file to truncate files in
the range of C++ standard.
I don't want to use the std::filesystem component because its support by
GCC is limited.
The concept of the StdFile class is to ensure portability of the file class
on every platform which support the C++17 standard.
However, ironically, no platform supports C++17 fully so the existence of
StdFile restricts portability.
I'll write a fall back function which internally use native system calls.
…On Wed, May 12, 2021 at 8:32 PM Eugene ***@***.***> wrote:
Readme.md:
To build the library, GCC 7.3 or later version is required.
Build for CentOS8 (gcc 8.3.1):
g++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -std=c++17 -pthread -fPIC -fsigned-char -o tkrzw_build_util tkrzw_build_util.o -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L. -L/usr/lib64 -Wl,-rpath-link,.:/usr/local/lib:.:/usr/local/lib: -Wl,--as-needed -L. -L/usr/lib64 -ltkrzw -lstdc++ -lrt -lpthread -lm -lc
./libtkrzw.so: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
./libtkrzw.so: undefined reference to `std::filesystem::resize_file(std::filesystem::__cxx11::path const&, unsigned long)'
collect2: error: ld returned 1 exit status
make: *** [Makefile:662: tkrzw_build_util] Error 1
(full log <https://koji.fedoraproject.org/koji/taskinfo?taskID=67758191>)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#17>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQGJVRBTKAWNEPKKCW25S3DTNJRNRANCNFSM44YNIJXA>
.
|
I worked around this for CentOS8 enabling GCC10 instead of 8.3 normally used. |
I committed a change to remove dependency on std::filesystem. |
May be this is too strict solution. |
In Tkrzw, only the truncating function used std::filesystem feature. Other operations related to path and the file system are implemented as utilities in tkrzw_file_util.h. Considering portability on systems including Windows and other Unix-like systems than Linux/Mac, the current policy is practical. I agree that the path object is smarter than char*, though. |
0.9.16 @ RH8 (GCC 8.3.1) ok |
Readme.md:
Build for CentOS8 (gcc 8.3.1):
(full log)
The text was updated successfully, but these errors were encountered: