Problems with compiling firmware

我使用了gl-inet官方给出的源码进行编译,在我没有修改任何内容时编译可以正常执行完毕,并且输出tar,但是当我尝试修改固件中的musl版本后,编译就遇到了问题,以下是关键日志,请帮助我查看一下是否能解决这个问题,谢谢。

Translated by DeepL
I used the official source code given by gl-inet to compile, the compilation can be executed normally and output tar when I didn't modify anything, but when I tried to modify the musl version in the firmware, the compilation encountered a problem, the following is the key log, please help me to see if I can solve this problem, thanks.

2023-02-26T04:24:35.3598674Z libtool: compile:  /workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/./gcc/xgcc -shared-libgcc -B/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/./gcc -nostdinc++ -L/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/src -L/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/src/.libs -L/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/libsupc++/.libs -B/workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/arm-openwrt-linux-muslgnueabi/bin/ -B/workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/arm-openwrt-linux-muslgnueabi/lib/ -isystem /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/arm-openwrt-linux-muslgnueabi/include -isystem /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/arm-openwrt-linux-muslgnueabi/sys-include -I/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0/libstdc++-v3/../libgcc -I/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/include/arm-openwrt-linux-muslgnueabi -I/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/include -I/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0/libstdc++-v3/libsupc++ -D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=bad_alloc.lo -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -c /workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0/libstdc++-v3/libsupc++/bad_alloc.cc  -fPIC -DPIC -D_GLIBCXX_SHARED -o bad_alloc.o
2023-02-26T04:24:35.3625894Z In file included from /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/pthread.h:30:0,
2023-02-26T04:24:35.3627093Z                  from /workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/include/arm-openwrt-linux-muslgnueabi/bits/gthr-default.h:35,
2023-02-26T04:24:35.3628563Z                  from /workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/include/arm-openwrt-linux-muslgnueabi/bits/gthr.h:148,
2023-02-26T04:24:35.3629613Z                  from /workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0/libstdc++-v3/libsupc++/atexit_thread.cc:27:
2023-02-26T04:24:35.3630815Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/sched.h:142:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3631477Z  __REDIR(sched_rr_get_interval, __sched_rr_get_interval_time64);
2023-02-26T04:24:35.3632070Z         ^
2023-02-26T04:24:35.3643557Z In file included from /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/pthread.h:31:0,
2023-02-26T04:24:35.3644725Z                  from /workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/include/arm-openwrt-linux-muslgnueabi/bits/gthr-default.h:35,
2023-02-26T04:24:35.3646369Z                  from /workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/include/arm-openwrt-linux-muslgnueabi/bits/gthr.h:148,
2023-02-26T04:24:35.3647403Z                  from /workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0/libstdc++-v3/libsupc++/atexit_thread.cc:27:
2023-02-26T04:24:35.3648698Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:136:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3649299Z  __REDIR(time, __time64);
2023-02-26T04:24:35.3649868Z         ^
2023-02-26T04:24:35.3652033Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:137:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3652660Z  __REDIR(difftime, __difftime64);
2023-02-26T04:24:35.3653222Z         ^
2023-02-26T04:24:35.3655229Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:138:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3655834Z  __REDIR(mktime, __mktime64);
2023-02-26T04:24:35.3656394Z         ^
2023-02-26T04:24:35.3658352Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:139:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3658962Z  __REDIR(gmtime, __gmtime64);
2023-02-26T04:24:35.3659517Z         ^
2023-02-26T04:24:35.3661486Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:140:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3662099Z  __REDIR(localtime, __localtime64);
2023-02-26T04:24:35.3662966Z         ^
2023-02-26T04:24:35.3685788Z /bin/bash ../libtool --tag CXX --tag disable-shared   --mode=compile /workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/./gcc/xgcc -shared-libgcc -B/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/./gcc -nostdinc++ -L/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/src -L/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/src/.libs -L/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/libsupc++/.libs -B/workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/arm-openwrt-linux-muslgnueabi/bin/ -B/workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/arm-openwrt-linux-muslgnueabi/lib/ -isystem /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/arm-openwrt-linux-muslgnueabi/include -isystem /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/arm-openwrt-linux-muslgnueabi/sys-include    -I/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0/libstdc++-v3/../libgcc -I/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/include/arm-openwrt-linux-muslgnueabi -I/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/include -I/workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0/libstdc++-v3/libsupc++  -prefer-pic -D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi  -fdiagnostics-show-location=once    -ffunction-sections -fdata-sections  -frandom-seed=bad_array_length.lo -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -std=gnu++11 -c /workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0/libstdc++-v3/libsupc++/bad_array_length.cc
2023-02-26T04:24:35.3692153Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:141:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3692598Z  __REDIR(ctime, __ctime64);
2023-02-26T04:24:35.3692804Z         ^
2023-02-26T04:24:35.3694493Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:142:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3694963Z  __REDIR(timespec_get, __timespec_get_time64);
2023-02-26T04:24:35.3695178Z         ^
2023-02-26T04:24:35.3696669Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:146:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3697113Z  __REDIR(gmtime_r, __gmtime64_r);
2023-02-26T04:24:35.3697311Z         ^
2023-02-26T04:24:35.3698756Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:147:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3699215Z  __REDIR(localtime_r, __localtime64_r);
2023-02-26T04:24:35.3699436Z         ^
2023-02-26T04:24:35.3700844Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:148:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3701277Z  __REDIR(ctime_r, __ctime64_r);
2023-02-26T04:24:35.3701482Z         ^
2023-02-26T04:24:35.3702941Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:149:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3703385Z  __REDIR(nanosleep, __nanosleep_time64);
2023-02-26T04:24:35.3703611Z         ^
2023-02-26T04:24:35.3705045Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:150:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3705509Z  __REDIR(clock_getres, __clock_getres_time64);
2023-02-26T04:24:35.3705726Z         ^
2023-02-26T04:24:35.3707146Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:151:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3707605Z  __REDIR(clock_gettime, __clock_gettime64);
2023-02-26T04:24:35.3707815Z         ^
2023-02-26T04:24:35.3709240Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:152:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3709695Z  __REDIR(clock_settime, __clock_settime64);
2023-02-26T04:24:35.3709923Z         ^
2023-02-26T04:24:35.3711339Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:153:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3711803Z  __REDIR(clock_nanosleep, __clock_nanosleep_time64);
2023-02-26T04:24:35.3712177Z         ^
2023-02-26T04:24:35.3713652Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:154:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3714099Z  __REDIR(timer_settime, __timer_settime64);
2023-02-26T04:24:35.3714320Z         ^
2023-02-26T04:24:35.3715740Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:155:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3716180Z  __REDIR(timer_gettime, __timer_gettime64);
2023-02-26T04:24:35.3716508Z         ^
2023-02-26T04:24:35.3717970Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:158:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3718390Z  __REDIR(stime, __stime64);
2023-02-26T04:24:35.3718586Z         ^
2023-02-26T04:24:35.3720653Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/time.h:159:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3721095Z  __REDIR(timegm, __timegm_time64);
2023-02-26T04:24:35.3721292Z         ^
2023-02-26T04:24:35.3740060Z In file included from /workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/include/arm-openwrt-linux-muslgnueabi/bits/gthr-default.h:35:0,
2023-02-26T04:24:35.3741142Z                  from /workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0-final/arm-openwrt-linux-muslgnueabi/libstdc++-v3/include/arm-openwrt-linux-muslgnueabi/bits/gthr.h:148,
2023-02-26T04:24:35.3741998Z                  from /workdir/gl-infra-builder/wlan-ap/openwrt/build_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/gcc-5.5.0/libstdc++-v3/libsupc++/atexit_thread.cc:27:
2023-02-26T04:24:35.3742831Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/pthread.h:232:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3743323Z  __REDIR(pthread_mutex_timedlock, __pthread_mutex_timedlock_time64);
2023-02-26T04:24:35.3743590Z         ^
2023-02-26T04:24:35.3745199Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/pthread.h:233:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3745716Z  __REDIR(pthread_cond_timedwait, __pthread_cond_timedwait_time64);
2023-02-26T04:24:35.3745965Z         ^
2023-02-26T04:24:35.3747452Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/pthread.h:234:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3747976Z  __REDIR(pthread_rwlock_timedrdlock, __pthread_rwlock_timedrdlock_time64);
2023-02-26T04:24:35.3748247Z         ^
2023-02-26T04:24:35.3749689Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/pthread.h:235:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3750200Z  __REDIR(pthread_rwlock_timedwrlock, __pthread_rwlock_timedwrlock_time64);
2023-02-26T04:24:35.3750471Z         ^
2023-02-26T04:24:35.3751918Z /workdir/gl-infra-builder/wlan-ap/openwrt/staging_dir/toolchain-arm_cortex-a7_gcc-5.5.0_musl_eabi/include/pthread.h:237:8: error: expected constructor, destructor, or type conversion before '(' token
2023-02-26T04:24:35.3752399Z  __REDIR(pthread_timedjoin_np, __pthread_timedjoin_np_time64);
2023-02-26T04:24:35.3752651Z         ^
2023-02-26T04:24:35.3919352Z make[8]: *** [Makefile:885: atexit_thread.lo] Error 1
2023-02-26T04:24:35.3919903Z make[8]: *** Waiting for unfinished jobs....

The you should ask them, why their source doesn't work...

2 Likes

But this error came only after I tried to update musl, and their firmware is also an openwrt, that's why I came here to ask the question...

The following applies to compiling and using 3rd party forks of OpenWrt.

It appears you are using firmware that is not from the official OpenWrt project.

When using forks/offshoots/vendor-specific builds that are "based on OpenWrt", there may be many differences compared to the official versions (hosted by OpenWrt.org). Some of these customizations may fundamentally change the way that OpenWrt works. You might need help from people with specific/specialized knowledge about the firmware you are using, so it is possible that advice you get here may not be useful.

You may find that the best options are:

  1. Install an official version of OpenWrt, if your device is supported (see https://firmware-selector.openwrt.org).
  2. Ask for help from the maintainer(s) or user community of the specific firmware that you are using.
  3. Provide the source code for the firmware so that users on this forum can understand how your firmware works (OpenWrt forum users are volunteers, so somebody might look at the code if they have time and are interested in your issue).

If you believe that this specific issue is common to generic/official OpenWrt and/or the maintainers of your build have indicated as such, please feel free to clarify.

3 Likes

Ok, thanks for your suggestion, I have also submitted the same question in their forum, thanks again

2 Likes