Я установил gcc 8.3.0 из источника.
Если я использую gcc с полным путем, он отлично работает.
$ /usr/bin/gcc test.c
Но если я использую gcc без полного пути, он будетвызвать ошибку:
$ gcc test.c
gcc: error trying to exec 'cc1': execvp: No such file or directory
- При компиляции файлов .cpp 'cc1' меняется на 'cc1plus'
Могу ли я решить эту проблему?Или этот gcc специфичен (должен использовать полный путь)?
пример источника:
//test.c or test.cpp
void main(){}
strace без полного пути (ошибка: 1):
- Почему gcc использует относительный путь для поиска cc1 / cc1plus ...?
- Я думаю, что gcc должен использовать абсолютный путь для поиска '/ usr / libexec / gcc / i686-test-linux/8.3.0/ 'directory.
execve("/bin/sh", ["/bin/sh", "-c", "gcc test.cpp -Wno-write-st"...], 0xbfbb4e68 /* 14 vars */) = 0
set_thread_area({entry_number=-1, base_addr=0x814816c, limit=0x0fffff, seg_32bit=1, contents=0, read_exec_only=0, limit_in_pages=1, seg_not_present=0, useable=1}) = 0 (entry_number=6)
set_tid_address(0x81489ec) = 16010
getuid32() = 0
brk(NULL) = 0x8cee000
brk(0x8cef000) = 0x8cef000
getpid() = 16010
rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 8) = 0
rt_sigaction(SIGCHLD, {sa_handler=0x80bee30, sa_mask=~[RTMIN RT_1 RT_2], sa_flags=SA_RESTORER, sa_restorer=0x8114571}, NULL, 8) = 0
rt_sigaction(SIGHUP, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x8114571}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
brk(0x8cf0000) = 0x8cf0000
getppid() = 16007
uname({sysname="Linux", nodename="DESLX", ...}) = 0
stat64("/tmp/linux-test", {st_mode=S_IFDIR|0755, st_size=260, ...}) = 0
stat64(".", {st_mode=S_IFDIR|0755, st_size=260, ...}) = 0
rt_sigaction(SIGINT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGINT, {sa_handler=0x80bee30, sa_mask=~[RTMIN RT_1 RT_2], sa_flags=SA_RESTORER, sa_restorer=0x8114571}, NULL, 8) = 0
rt_sigaction(SIGQUIT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_IGN, sa_mask=~[RTMIN RT_1 RT_2], sa_flags=SA_RESTORER, sa_restorer=0x8114571}, NULL, 8) = 0
rt_sigaction(SIGTERM, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
stat64("/sbin/gcc", 0xbf92665c) = -1 ENOENT (No such file or directory)
stat64("/usr/sbin/gcc", 0xbf92665c) = -1 ENOENT (No such file or directory)
stat64("/bin/gcc", 0xbf92665c) = -1 ENOENT (No such file or directory)
stat64("/usr/bin/gcc", {st_mode=S_IFREG|0755, st_size=1490096, ...}) = 0
execve("/usr/bin/gcc", ["gcc", "test.cpp", "-Wno-write-strings"], 0x8cee314 /* 14 vars */) = 0
set_thread_area({entry_number=-1, base_addr=0x8177bf4, limit=0x0fffff, seg_32bit=1, contents=0, read_exec_only=0, limit_in_pages=1, seg_not_present=0, useable=1}) = 0 (entry_number=6)
set_tid_address(0x8177dc8) = 16010
brk(NULL) = 0x853b000
brk(0x853c000) = 0x853c000
brk(NULL) = 0x853c000
brk(0x853e000) = 0x853e000
brk(0x854f000) = 0x854f000
brk(0x8550000) = 0x8550000
ioctl(2, TIOCGWINSZ, 0xbfd450f8) = -1 EINVAL (Invalid argument)
ioctl(2, TIOCGWINSZ, 0xbfd450f8) = -1 EINVAL (Invalid argument)
rt_sigaction(SIGINT, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 8) = 0
rt_sigaction(SIGINT, {sa_handler=0x804cc90, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, 8) = 0
rt_sigaction(SIGHUP, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGHUP, {sa_handler=0x804cc90, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, 8) = 0
rt_sigaction(SIGTERM, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGTERM, {sa_handler=0x804cc90, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, 8) = 0
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGPIPE, {sa_handler=0x804cc90, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, 8) = 0
rt_sigaction(SIGCHLD, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, {rlim_cur=65536*1024, rlim_max=RLIM64_INFINITY}, NULL) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
brk(0x8551000) = 0x8551000
brk(0x8552000) = 0x8552000
open("gcc", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
open("gcc", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
access("test.cpp", F_OK) = 0
access("../lib/gcc/i686-test-linux/8.3.0/", X_OK) = -1 ENOENT (No such file or directory)
access("../lib/gcc/i686-test-linux/", X_OK) = -1 ENOENT (No such file or directory)
access("../lib/gcc/", X_OK) = -1 ENOENT (No such file or directory)
access("../lib/", X_OK) = -1 ENOENT (No such file or directory)
access("../lib/gcc/i686-test-linux/8.3.0/", X_OK) = -1 ENOENT (No such file or directory)
access("../lib/gcc/i686-test-linux/", X_OK) = -1 ENOENT (No such file or directory)
access("../lib/gcc/", X_OK) = -1 ENOENT (No such file or directory)
access("../lib/", X_OK) = -1 ENOENT (No such file or directory)
open("gcc", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC|O_PATH) = -1 ENOENT (No such file or directory)
brk(0x8553000) = 0x8553000
access("../../usr", F_OK) = 0
access("../lib/gcc/i686-test-linux/8.3.0/specs", R_OK) = -1 ENOENT (No such file or directory)
access("../lib/gcc/specs", R_OK) = -1 ENOENT (No such file or directory)
access("../i686-test-linux/lib/i686-test-linux/8.3.0/specs", R_OK) = -1 ENOENT (No such file or directory)
access("../i686-test-linux/lib/specs", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/specs", R_OK) = -1 ENOENT (No such file or directory)
access("../lib/gcc/i686-test-linux/8.3.0/", X_OK) = -1 ENOENT (No such file or directory)
access("../lib/gcc/i686-test-linux/", X_OK) = -1 ENOENT (No such file or directory)
access("../lib/gcc/", X_OK) = -1 ENOENT (No such file or directory)
access("../", X_OK) = 0
access("../", X_OK) = 0
brk(0x8554000) = 0x8554000
stat64("../libexec/gcc/i686-test-linux/8.3.0/lto-wrapper", 0xbfd44ff0) = -1 ENOENT (No such file or directory)
stat64("../libexec/gcc/lto-wrapper", 0xbfd44ff0) = -1 ENOENT (No such file or directory)
stat64("../i686-test-linux/bin/i686-test-linux/8.3.0/lto-wrapper", 0xbfd44ff0) = -1 ENOENT (No such file or directory)
stat64("../i686-test-linux/bin/lto-wrapper", 0xbfd44ff0) = -1 ENOENT (No such file or directory)
access("/tmp", R_OK|W_OK|X_OK) = 0
clock_gettime(CLOCK_REALTIME, {tv_sec=1561737190, tv_nsec=72258100}) = 0
open("/tmp/ccKGEANB.s", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600) = 3
close(3) = 0
stat64("../libexec/gcc/i686-test-linux/8.3.0/cc1plus", 0xbfd44660) = -1 ENOENT (No such file or directory)
stat64("../libexec/gcc/cc1plus", 0xbfd44660) = -1 ENOENT (No such file or directory)
stat64("../i686-test-linux/bin/i686-test-linux/8.3.0/cc1plus", 0xbfd44660) = -1 ENOENT (No such file or directory)
stat64("../i686-test-linux/bin/cc1plus", 0xbfd44660) = -1 ENOENT (No such file or directory)
vfork(gcc: error trying to exec 'cc1plus': execvp: No such file or directory
) = 16011
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16011, si_uid=0, si_status=255, si_utime=0, si_stime=0} ---
wait4(16011, [{WIFEXITED(s) && WEXITSTATUS(s) == 255}], 0, NULL) = 16011
stat64("/tmp/ccKGEANB.s", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
unlink("/tmp/ccKGEANB.s") = 0
exit_group(1) = ?
+++ exited with 1 +++
strace с полным путем (ошибка: 0):
execve("/bin/sh", ["/bin/sh", "-c", "/usr/bin/gcc test.cpp -Wno"...], 0xbffa0bc8 /* 14 vars */) = 0
set_thread_area({entry_number=-1, base_addr=0x814816c, limit=0x0fffff, seg_32bit=1, contents=0, read_exec_only=0, limit_in_pages=1, seg_not_present=0, useable=1}) = 0 (entry_number=6)
set_tid_address(0x81489ec) = 16029
getuid32() = 0
brk(NULL) = 0x8f18000
brk(0x8f19000) = 0x8f19000
getpid() = 16029
rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 8) = 0
rt_sigaction(SIGCHLD, {sa_handler=0x80bee30, sa_mask=~[RTMIN RT_1 RT_2], sa_flags=SA_RESTORER, sa_restorer=0x8114571}, NULL, 8) = 0
rt_sigaction(SIGHUP, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x8114571}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
brk(0x8f1a000) = 0x8f1a000
getppid() = 16026
uname({sysname="Linux", nodename="DESLX", ...}) = 0
stat64("/tmp/linux-test", {st_mode=S_IFDIR|0755, st_size=260, ...}) = 0
stat64(".", {st_mode=S_IFDIR|0755, st_size=260, ...}) = 0
rt_sigaction(SIGINT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGINT, {sa_handler=0x80bee30, sa_mask=~[RTMIN RT_1 RT_2], sa_flags=SA_RESTORER, sa_restorer=0x8114571}, NULL, 8) = 0
rt_sigaction(SIGQUIT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_IGN, sa_mask=~[RTMIN RT_1 RT_2], sa_flags=SA_RESTORER, sa_restorer=0x8114571}, NULL, 8) = 0
rt_sigaction(SIGTERM, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
execve("/usr/bin/gcc", ["/usr/bin/gcc", "test.cpp", "-Wno-write-strings"], 0x8f1832c /* 14 vars */) = 0
set_thread_area({entry_number=-1, base_addr=0x8177bf4, limit=0x0fffff, seg_32bit=1, contents=0, read_exec_only=0, limit_in_pages=1, seg_not_present=0, useable=1}) = 0 (entry_number=6)
set_tid_address(0x8177dc8) = 16029
brk(NULL) = 0x986d000
brk(0x986e000) = 0x986e000
brk(NULL) = 0x986e000
brk(0x9870000) = 0x9870000
brk(0x9881000) = 0x9881000
brk(0x9882000) = 0x9882000
ioctl(2, TIOCGWINSZ, 0xbfec0478) = -1 EINVAL (Invalid argument)
ioctl(2, TIOCGWINSZ, 0xbfec0478) = -1 EINVAL (Invalid argument)
rt_sigaction(SIGINT, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 8) = 0
rt_sigaction(SIGINT, {sa_handler=0x804cc90, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, 8) = 0
rt_sigaction(SIGHUP, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGHUP, {sa_handler=0x804cc90, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, 8) = 0
rt_sigaction(SIGTERM, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGTERM, {sa_handler=0x804cc90, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, 8) = 0
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGPIPE, {sa_handler=0x804cc90, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, 8) = 0
rt_sigaction(SIGCHLD, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x80d9557}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, {rlim_cur=65536*1024, rlim_max=RLIM64_INFINITY}, NULL) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
brk(0x9883000) = 0x9883000
brk(0x9884000) = 0x9884000
open("/usr/bin/gcc", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC|O_PATH) = 3
readlink("/proc/self/fd/3", "/usr/bin/gcc", 4095) = 12
fstat64(3, {st_mode=S_IFREG|0755, st_size=1490096, ...}) = 0
stat64("/usr/bin/gcc", {st_mode=S_IFREG|0755, st_size=1490096, ...}) = 0
close(3) = 0
open("/usr/bin/gcc", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC|O_PATH) = 3
readlink("/proc/self/fd/3", "/usr/bin/gcc", 4095) = 12
fstat64(3, {st_mode=S_IFREG|0755, st_size=1490096, ...}) = 0
stat64("/usr/bin/gcc", {st_mode=S_IFREG|0755, st_size=1490096, ...}) = 0
close(3) = 0
access("test.cpp", F_OK) = 0
access("/usr/lib/gcc/i686-test-linux/8.3.0/", X_OK) = 0
access("/usr/lib/gcc/i686-test-linux/8.3.0/", X_OK) = 0
brk(0x9885000) = 0x9885000
access("/usr/lib/gcc/i686-test-linux/8.3.0/specs", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/lib/i686-test-linux/8.3.0/specs", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/lib/specs", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/specs", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/", X_OK) = 0
brk(0x9886000) = 0x9886000
stat64("/usr/libexec/gcc/i686-test-linux/8.3.0/lto-wrapper", {st_mode=S_IFREG|0755, st_size=1397652, ...}) = 0
access("/usr/libexec/gcc/i686-test-linux/8.3.0/lto-wrapper", X_OK) = 0
brk(0x9887000) = 0x9887000
access("/tmp", R_OK|W_OK|X_OK) = 0
clock_gettime(CLOCK_REALTIME, {tv_sec=1561737208, tv_nsec=84838200}) = 0
open("/tmp/ccoIKDmM.s", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600) = 3
close(3) = 0
stat64("/usr/libexec/gcc/i686-test-linux/8.3.0/cc1plus", {st_mode=S_IFREG|0755, st_size=30230160, ...}) = 0
access("/usr/libexec/gcc/i686-test-linux/8.3.0/cc1plus", X_OK) = 0
vfork() = 16030
wait4(16030, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 16030
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16030, si_uid=0, si_status=0, si_utime=38, si_stime=3} ---
clock_gettime(CLOCK_REALTIME, {tv_sec=1561737208, tv_nsec=558595000}) = 0
open("/tmp/ccaIfIIE.o", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600) = 3
close(3) = 0
stat64("/usr/libexec/gcc/i686-test-linux/8.3.0/as", 0xbfec0280) = -1 ENOENT (No such file or directory)
stat64("/usr/libexec/gcc/i686-test-linux/8.3.0/as", 0xbfec0280) = -1 ENOENT (No such file or directory)
stat64("/usr/libexec/gcc/i686-test-linux/as", 0xbfec0280) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/as", 0xbfec0280) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/gcc/i686-test-linux/as", 0xbfec0280) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/bin/i686-test-linux/8.3.0/as", 0xbfec0280) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/bin/as", {st_mode=S_IFREG|0755, st_size=1780284, ...}) = 0
access("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/bin/as", X_OK) = 0
vfork() = 16031
wait4(16031, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 16031
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16031, si_uid=0, si_status=0, si_utime=1, si_stime=0} ---
stat64("/usr/libexec/gcc/i686-test-linux/8.3.0/collect2", {st_mode=S_IFREG|0755, st_size=1058760, ...}) = 0
access("/usr/libexec/gcc/i686-test-linux/8.3.0/collect2", X_OK) = 0
stat64("/usr/libexec/gcc/i686-test-linux/8.3.0/.", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0
stat64("/usr/libexec/gcc/i686-test-linux/8.3.0/.", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0
stat64("/usr/libexec/gcc/i686-test-linux/.", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/.", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0
stat64("/usr/lib/gcc/i686-test-linux/.", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/bin/i686-test-linux/8.3.0/.", 0xbfec0360) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/bin/.", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/.", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/lib/i686-test-linux/8.3.0/.", 0xbfec0360) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/lib/.", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/../../../i686-test-linux/8.3.0/.", 0xbfec0360) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/../../../.", {st_mode=S_IFDIR|0777, st_size=24576, ...}) = 0
stat64("/usr/lib/i686-test-linux/8.3.0/.", 0xbfec0360) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/.", {st_mode=S_IFDIR|0777, st_size=24576, ...}) = 0
stat64("/usr/usr/lib/i686-test-linux/8.3.0/.", 0xbfec0360) = -1 ENOENT (No such file or directory)
stat64("/usr/usr/lib/.", 0xbfec0360) = -1 ENOENT (No such file or directory)
brk(0x9888000) = 0x9888000
brk(0x9889000) = 0x9889000
brk(0x988a000) = 0x988a000
brk(0x988b000) = 0x988b000
brk(0x988c000) = 0x988c000
access("/usr/lib/gcc/i686-test-linux/8.3.0/crt1.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/lib/i686-test-linux/8.3.0/crt1.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/lib/crt1.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/../../../i686-test-linux/8.3.0/crt1.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/../../../crt1.o", R_OK) = 0
access("/usr/lib/gcc/i686-test-linux/8.3.0/crti.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/lib/i686-test-linux/8.3.0/crti.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/lib/crti.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/../../../i686-test-linux/8.3.0/crti.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/../../../crti.o", R_OK) = 0
access("/usr/lib/gcc/i686-test-linux/8.3.0/crtbegin.o", R_OK) = 0
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/.", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/lib/i686-test-linux/8.3.0/.", 0xbfebfb00) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/lib/.", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/../../../i686-test-linux/8.3.0/.", 0xbfebfb00) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/gcc/i686-test-linux/8.3.0/../../../.", {st_mode=S_IFDIR|0777, st_size=24576, ...}) = 0
stat64("/usr/lib/i686-test-linux/8.3.0/.", 0xbfebfb00) = -1 ENOENT (No such file or directory)
stat64("/usr/usr/lib/i686-test-linux/8.3.0/.", 0xbfebfb00) = -1 ENOENT (No such file or directory)
stat64("/usr/usr/lib/.", 0xbfebfb00) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/crtend.o", R_OK) = 0
access("/usr/lib/gcc/i686-test-linux/8.3.0/crtn.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/lib/i686-test-linux/8.3.0/crtn.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/../../../../i686-test-linux/lib/crtn.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/../../../i686-test-linux/8.3.0/crtn.o", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/gcc/i686-test-linux/8.3.0/../../../crtn.o", R_OK) = 0
stat64("/usr/libexec/gcc/i686-test-linux/8.3.0/collect2", {st_mode=S_IFREG|0755, st_size=1058760, ...}) = 0
access("/usr/libexec/gcc/i686-test-linux/8.3.0/collect2", X_OK) = 0
vfork() = 16032
wait4(16032, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 16032
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16032, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
stat64("/tmp/ccaIfIIE.o", {st_mode=S_IFREG|0600, st_size=175096, ...}) = 0
unlink("/tmp/ccaIfIIE.o") = 0
stat64("/tmp/ccoIKDmM.s", {st_mode=S_IFREG|0600, st_size=333416, ...}) = 0
unlink("/tmp/ccoIKDmM.s") = 0
exit_group(0) = ?
+++ exited with 0 +++
Примененные исправления для gcc: (для поддержкиmusl в *-test-linux-gnu
)
diff -- a/gcc/config.gcc b/gcc/config.gcc
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -779,7 +779,7 @@ case ${target} in
*-*-*uclibc*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
;;
- *-*-*musl*)
+ *-*-*musl* | *-test-*-gnu )
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
;;
*)
diff -- a/libstdc++-v3/configure b/libstdc++-v3/configure
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -28912,7 +28912,7 @@ else
# First, test for "known" system libraries. We may be using newlib even
# on a hosted environment.
if test "x${with_newlib}" = "xyes"; then
- os_include_dir="os/newlib"
+ os_include_dir="os/generic"
$as_echo "#define HAVE_HYPOT 1" >>confdefs.h
diff -- a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -393,3 +393,11 @@ case "${host}" in
abi_baseline_subdir_switch=--print-multi-os-directory
;;
esac
+
+# TEST Linux patch
+case "${host}" in
+ *-test-* | *-test-dev-* )
+ os_include_dir="os/generic"
+ ;;
+esac
+
. / configure options (gcc - ###):
Using built-in specs.
COLLECT_GCC=gcc
Target: i686-test-linux
Configured with: /l/src/build/i686-test-linux/gcc-8.3.0/configure CFLAGS='-static -O2' CXXFLAGS='-static -O2'
--build=i686-test-linux --host=i686-test-linux --target=i686-test-linux --prefix=/usr/ --with-sysroot=/usr/
--with-native-system-header-dir=/include --with-local-prefix=/usr/ --with-newlib --without-headers --enable-languages=c,c++
--disable-libstdcxx --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads
--disable-libada --disable-libatomic --disable-libffi --disable-libgomp --disable-libhsail-rt --disable-libitm
--disable-libmpx --disable-libobjc --disable-liboffloadmic --disable-libquadmath --disable-libsanitizer --disable-libssp
--disable-libstdc++-v3 --disable-libvtv --disable-bootstrap
Thread model: single
gcc version 8.3.0 (TEST Embedded Linux Toolchain for [i686])```
Я уже проверял эти изменения, но нерешено:
- '/ usr /' to '/ usr'
- remove: '-static' во FLAGS, --disable-bootstrap
- '/ include'to' / usr / include ': это будет читать включаемые файлы из' / usr / usr / include '.Не может использоваться.
Моя среда linux имеет только:
- ядро (v4.19.34, defconfig + модули Hyper-V: [y])
- busybox (v1.30.1, все апплеты)
- binutils (v2.32)
- gcc (v8.30)
- musl (v1.1.22)
- libstdc ++ v3 (с musl)
Примечание. В моем linux нет менеджеров пакетов.Поэтому не может использовать его как 'sudo apt-get install g ++'