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

multiple related updates: gnulib, coreutils, gettext-full, elfutils #14802

Merged

Conversation

guidosarducci
Copy link
Contributor

@guidosarducci guidosarducci commented Mar 6, 2024

Description

This series began as an update of dwarves and its related dependencies, several of which are out of date and just recently updated. It includes toolchain/musl 1.25, the latest stable tools/gnulib, both tools/elfutils and elfutils synced to version 0.191, and a dwarves maintainer updated missed when I created the package.

Testing

Build and run tested using QEMU with malta/le64 and arm/32.

Reviewer Requests

@mpratt14 added host gnulib and @nbd168 modified host elfutils with gnulib to enable MacOS support.
@luizluca maintains package elfutils and @PolynomialDivision worked on an elfutils 0.190 update in #13871.

I only noticed writing this PR that @hnyman also opened a musl update PR #14765, and ran into some of the same issues as me. However, in this PR I've worked to fix the issues related to the <string.h> vs <libgen.h> change rather than revert it.

Related

Background on the musl basename() changes: https://git.musl-libc.org/cgit/musl/log/?qt=grep&q=basename.

After reviewing our packages and feeds, there are only a small number of simple fixes needed:

  1. procd is fixed by trace: use standard POSIX header for basename() procd#6
  2. rpcd-mod-luci is fixed by rpcd-mod-luci: use standard POSIX header for basename() luci#6968.
  3. zabbix is fixed by zabbix: zabbix_helper_mac80211.c: add <libgen.h> header packages#23599.

@github-actions github-actions bot added build/scripts/tools pull request/issues for build, scripts and tools related changes core packages pull request/issue for core (in-tree) packages toolchain pull request/issue with toolchain related changes labels Mar 6, 2024
@guidosarducci
Copy link
Contributor Author

All the test failures are occurring during the Build tools phase and result from a problem downloading gnulib from an OpenWrt mirror. Runners are trying to download https://mirror2.openwrt.org/sources/gnulib-c99c8d491850dc3a6e0b8604a2729d8bc5c0eff1.tar.gz, which doesn't exist on the server.

Anyone understand why download from an upstream source isn't tried?

@guidosarducci
Copy link
Contributor Author

A few of the last CI build errors are with gettext-full:

In file included from ../../gettext-runtime/intl/localealias.c:61:
../../gettext-runtime/intl/gettextP.h:71:11: fatal error: libgnuintl.h: No such file or directory
   71 | # include "libgnuintl.h"
      |           ^~~~~~~~~~~~~~
compilation terminated.
make[9]: *** [Makefile:4437: ../../gettext-runtime/intl/msginit-localealias.o] Error 1

I didn't see this in my local builds but managed to reproduce it (when enabling zabbix). Updating gettext-full to the latest stable version seems to fix this locally, so I'll rebase and push that update too.

@guidosarducci guidosarducci force-pushed the master-update-dwarves-elfutils-gnulib branch from 88bf02a to ac5bf56 Compare March 6, 2024 13:35
@guidosarducci
Copy link
Contributor Author

guidosarducci commented Mar 7, 2024

CI Check Summary

Good news, most all tests pass! The 3 remaining build errors are:

  1. Build libbpf on arch x86/64: https://github.com/openwrt/openwrt/actions/runs/8172980672/job/22345074498?pr=14802#step:34:527
====== Make errors from logs/package/libs/libbpf/compile.txt ======
make[4]: Entering directory '/__w/openwrt/openwrt/openwrt/build_dir/target-x86_64-openwrt-linux-musl_musl/libbpf-1.3.0/src'
  MKDIR    staticobjs
  MKDIR    sharedobjs
  CC       staticobjs/bpf.o
  CC       staticobjs/btf.o
In file included from btf.c:18:
/__w/openwrt/openwrt/openwrt/staging_dir/target-x86_64-openwrt-linux-musl_musl/usr/include/gelf.h:86:9: error: unknown type name 'Elf64_Relr'
   86 | typedef Elf64_Relr GElf_Relr;
      |         ^~~~~~~~~~
cc1: note: unrecognized command-line option '-Wno-unknown-warning-option' may have been intended to silence earlier diagnostics
make[4]: *** [Makefile:135: staticobjs/btf.o] Error 1
  1. Build libbpf on arch malta/be: https://github.com/openwrt/openwrt/actions/runs/8172980672/job/22345063189?pr=14802#step:34:504
====== Make errors from logs/package/libs/libbpf/compile.txt ======
make[4]: Entering directory '/__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/libbpf-1.3.0/src'
  MKDIR    staticobjs
  MKDIR    sharedobjs
  CC       staticobjs/bpf.o
  CC       staticobjs/btf.o
In file included from btf.c:18:
/__w/openwrt/openwrt/openwrt/staging_dir/target-mips-openwrt-linux-musl_musl/usr/include/gelf.h:86:9: error: unknown type name 'Elf64_Relr'
   86 | typedef Elf64_Relr GElf_Relr;
      |         ^~~~~~~~~~
cc1: note: unrecognized command-line option '-Wno-unknown-warning-option' may have been intended to silence earlier diagnostics
make[4]: *** [Makefile:135: staticobjs/btf.o] Error 1
  1. Build tools/elfutils and tools/libtool on MacOS: https://github.com/openwrt/openwrt/actions/runs/8172980671/job/22344385380?pr=14802#step:6:70
====== Make errors from logs/tools/elfutils/compile.txt ======
logs/tools/elfutils/compile.txt-_GL_FUNCDECL_SYS (reallocarray, void *,
logs/tools/elfutils/compile.txt-                  ^
logs/tools/elfutils/compile.txt-In file included from xasprintf.c:37:
logs/tools/elfutils/compile.txt-./system.h:125:9: warning: 'gettext_noop' macro redefined [-Wmacro-redefined]
logs/tools/elfutils/compile.txt-#define gettext_noop(Str) Str
logs/tools/elfutils/compile.txt-        ^
logs/tools/elfutils/compile.txt-../libgnu/gettext.h:109:9: note: previous definition is here
logs/tools/elfutils/compile.txt-#define gettext_noop(String) String
logs/tools/elfutils/compile.txt-        ^
logs/tools/elfutils/compile.txt-1 warning and 1 error generated.
logs/tools/elfutils/compile.txt:make[5]: *** [Makefile:1450: xasprintf.lo] Error 1

and

====== Make errors from logs/tools/libtool/compile.txt ======
logs/tools/libtool/compile.txt-
logs/tools/libtool/compile.txt-Applying /Volumes/OpenWrt/openwrt/tools/libtool/patches/140-don-t-quote-SHELL-in-Makefile.am.patch using plaintext: 
logs/tools/libtool/compile.txt-patching file Makefile.am
logs/tools/libtool/compile.txt-
logs/tools/libtool/compile.txt-Applying /Volumes/OpenWrt/openwrt/tools/libtool/patches/200-openwrt-branding.patch using plaintext: 
logs/tools/libtool/compile.txt-patching file build-aux/ltmain.in
logs/tools/libtool/compile.txt-patching file build-aux/funclib.sh
logs/tools/libtool/compile.txt-make[3]: Entering directory '/Volumes/OpenWrt/openwrt/build_dir/host/libtool-2.4.7'
logs/tools/libtool/compile.txt-There seems to be no Makefile in this directory.
logs/tools/libtool/compile.txt-You must run ./configure before running 'make'.
logs/tools/libtool/compile.txt:make[3]: *** [GNUmakefile:108: abort-due-to-no-makefile] Error 1
logs/tools/libtool/compile.txt-make[3]: Leaving directory '/Volumes/OpenWrt/openwrt/build_dir/host/libtool-2.4.7'
logs/tools/libtool/compile.txt-bootstrap: warning: No 'git' found; imported gnulib modules may be outdated.
logs/tools/libtool/compile.txt-bootstrap: running: git submodule init -- gl-mod/bootstrap
logs/tools/libtool/compile.txt-fatal: not a git repository (or any of the parent directories): .git
logs/tools/libtool/compile.txt-bootstrap: running: git submodule update -- gl-mod/bootstrap
logs/tools/libtool/compile.txt-fatal: not a git repository (or any of the parent directories): .git
logs/tools/libtool/compile.txt-bootstrap: running: /Volumes/OpenWrt/openwrt/staging_dir/host/share/gnulib/gnulib-tool --no-changelog --avoid=dummy --libtool --macro-prefix=GL --with-tests --tests-base=gnulib-tests --aux-dir=build-aux --m4-base=m4 --local-dir=gl --local-dir=gl-mod/bootstrap --symlink --import announce-gen bootstrap...
logs/tools/libtool/compile.txt-gnulib-tool: warning: module bootstrap doesn't exist
logs/tools/libtool/compile.txt-gnulib-tool: warning: module extract-trace doesn't exist
logs/tools/libtool/compile.txt-gnulib-tool: warning: module inline-source doesn't exist
Error: Process completed with exit code 2.

Thoughts

  1. Concerning failures 1 & 2, the error: unknown type name 'Elf64_Relr' is known to occur with elfutils >= 0.190 but should be fixed by musl 1.2.5 with this commit. Also, this error doesn't happen on my local build.

Is it possible that package elfutils and toolchain/musl are not being properly built and installed into the containers?

  1. Regarding the MacOS "Build tools" failure, I also see many warning: 'gettext_noop' macro redefined messages building under Linux but they're harmless (identical definitions). The cause is that both gnulib and elfutils are defining gettext_noop() and some others.

@nbd168 and @mpratt14 Did either of you see similar warnings when you first added gnulib and migrated tools/elfutils to use it? What problems did you see managing different sources of gettext-related includes and defines?

The other MacOS failure is with building tools/libtool. Can anyone say if this is known to work? @httpstorm Could you comment Georgi?

I also noticed @feckert ran into a similar issue in #12565 . Could you share the underlying problem you needed to fix?

@mpratt14
Copy link
Contributor

mpratt14 commented Mar 7, 2024

the libtool error is fake, ignore it for now...

I don't have a Mac so I can only offer advice for coreutils, which I expect will be the next thing to fail in host tools build once you figure out elfutils, based on #13132

feel free to pull my patch in the comments if you want and if it's discovered that we would still need it

@guidosarducci
Copy link
Contributor Author

Hmm, how is the libtool error fake? Looking at https://github.com/openwrt/openwrt/actions/runs/8172980671/job/22344385380?pr=14802#step:6:87 it seems a real failure to build, with the same message as you/Florian saw before:

logs/tools/libtool/compile.txt-make[3]: Entering directory '/Volumes/OpenWrt/openwrt/build_dir/host/libtool-2.4.7'
logs/tools/libtool/compile.txt-There seems to be no Makefile in this directory.
logs/tools/libtool/compile.txt-You must run ./configure before running 'make'.
logs/tools/libtool/compile.txt:make[3]: *** [GNUmakefile:108: abort-due-to-no-makefile] Error 1

Could you clarify what you mean? Also, since I haven't touched coreutils, how do you believe it might be related?

@mpratt14
Copy link
Contributor

mpratt14 commented Mar 7, 2024

no, the libtool error is not related to coreutils, but coreutils might be broken for mac build because of updating gnulib

i don't know why the libtool error shows, but I have experienced it appear before and then later disappear after the other program's error is fixed.

in particular, notice that before the output from the script which prints the 10 lines of verbose logs in the CI log, that there is only an "ERROR" line for elfutils

@mpratt14
Copy link
Contributor

mpratt14 commented Mar 7, 2024

by the way, you should stop referring to the issue #12565 as there was nothing wrong (per last comment)

@guidosarducci
Copy link
Contributor Author

guidosarducci commented Mar 7, 2024

no, the libtool error is not related to coreutils, but coreutils might be broken for mac build because of updating gnulib

It's possible, but MacOS CI builds also failed before for a PR updating only tools/elfutils to 0.190 (#13871), thus hard to be sure what the issue is without MacOS access.

In any case, I'll try building with the tools/coreutils update locally, and if it works I'll push it to this PR just to retry the CI builds. Note that @PolynomialDivision has such a PR already in #14677, and its CI build also failed on MacOS.

in particular, notice that before the output from the script which prints the 10 lines of verbose logs in the CI log, that there is only an "ERROR" line for elfutils

What do think that suggests? I might not be seeing it...

by the way, you should stop referring to the issue #12565 as there was nothing wrong (per last comment)

According to @feckert the problem disappeared after reverting a local patch, so I wanted to understand what that was and if it might be related to the problem here.

@luizluca
Copy link
Contributor

luizluca commented Mar 7, 2024

Thanks @guidosarducci for this PR. I ended up as elfutils maintainer by accident. I'm overdue to drop my name from the package.

There are probably some package/libs/elfutils/ and tools/elfutils differences that should not exist. Both mostly have a common goal of buildling elfutils. The tools/elfutils/patches/100-portability.patch gives me creeps. It touches different not directly related aspects, including overlaps with package/libs/elfutils patches and many mac specific changes. It should be logically divided into smaller units and upstreamed as much as possible. However, it is a job for another PR.

@robimarko
Copy link
Contributor

The amount of random this "fixes MacOS patches are crazy"

@mpratt14
Copy link
Contributor

mpratt14 commented Mar 7, 2024

In any case, I'll try building with the tools/coreutils update locally, and if it works I'll push it to this PR just to retry the CI builds. Note that @PolynomialDivision has such a PR already in #14677, and its CI build also failed on MacOS.

just to be clear, the elfutils issue still needs fixing, I'm just thinking ahead

he never pulled the patch that I linked in that PR

in particular, notice that before the output from the script which prints the 10 lines of verbose logs in the CI log, that there is only an "ERROR" line for elfutils

What do think that suggests? I might not be seeing it...

that the libtool error is fake

@mpratt14
Copy link
Contributor

mpratt14 commented Mar 7, 2024

I'd like to start looking at the elfutils macOS problem even though I don't have one, but the 10 last lines of output isn't enough to see the actual problem, it's just the harmless warning at the end...

@guidosarducci guidosarducci force-pushed the master-update-dwarves-elfutils-gnulib branch from ac5bf56 to c14bf6a Compare March 8, 2024 00:12
@guidosarducci
Copy link
Contributor Author

The amount of random this "fixes MacOS patches are crazy"

@robimarko Yes, I agree and am not pleased. The addition of gnulib itself feels like a "MacOS patch" to get elfutils building there, but ends up needlessly affecting Linux builds, seemingly becoming entangled with other package builds, and making usage more fragile.

Thanks @guidosarducci for this PR. I ended up as elfutils maintainer by accident. I'm overdue to drop my name from the package.

@luizluca Well, thanks for sticking around this far, and I hope you can continue as maintainer. Too many foundational packages (e.g. tools/gnulib, tools/elfutils) lack a maintainer, and even then updates bypassing maintainers are common, with said updates often skimping on details like "testing" and "consequences".

There are probably some package/libs/elfutils/ and tools/elfutils differences that should not exist. Both mostly have a common goal of buildling elfutils. The tools/elfutils/patches/100-portability.patch gives me creeps. It touches different not directly related aspects, including overlaps with package/libs/elfutils patches and many mac specific changes. It should be logically divided into smaller units and upstreamed as much as possible. However, it is a job for another PR.

For goodness sake, yes! I'd really like to see the "gnulibification" of elfutils in 5331e85 pushed upstream and result in some simple "--use-gnulib" configure flag.

@guidosarducci
Copy link
Contributor Author

guidosarducci commented Mar 8, 2024

Some updates...

I included the tools/coreutils 9.4 update from @PolynomialDivision #14677 and pushed to restart CI checks, but the MacOS build still fails. I want to add that I've seen several other PRs with failing MacOS CI builds, so there may be something wrong with that VM setup.

Regarding the libbpf/bpftool build failures on x86_64/generic and malta/mipseb32, those shouldn't be happening based on the updates in this PR and my past local testing of those packages. I also just tried a clean (rebuild host and target tools/toolchain/packages from scratch) x86_64/generic local Linux build with success.

So we'll need to look at the detailed build logs, which I'll include here to avoid CI logs disappearing:
x86-64-logs.zip
malta-be-logs.zip
macos-latest-logs.zip

Some odd behaviour...

libbpf / bpftool


As I noted in #14802 (comment), the libbpf/bpftool compile errors are consistent with tools/elfutils and/or toolchain/musl not being updated, and if I look at the compile logs I see neither of these being built!

Could someone double check? Here are the logs for tools/elfutils: check-compile.txt compile.txt

Is it possible that tools items are not being compiled/installed?

MacOS


Looking at logs for tools sub-directory, I see for example tools/automake and tools/libtool compiled and installed. However, tools/gnulib downloads but doesn't even try to compile, and I don't see logs at all for tools/coreutils or toolchain/musl. The compile errors for tools/elfutils are natural given the other failures.

Help?

Could one of the members familiar with CI operations please double-check my findings and if true help understand why some tools targets are not being built? Maybe @Ansuel or @aparcar would comment?

@httpstorm
Copy link
Contributor

httpstorm commented Mar 12, 2024

@guidosarducci
Hi Tony, I'm sorry for coming late, I just saw this today. Feel free to catch my attention with mail in the future.
Let me know of any patches you want tested on macOS and I'll do my best to help you.

I was able to compile for both WRT3200ACM and TL-WR1043N/ND v4. I haven't tested either yet.
The first isn't with me at the moment, so I can only deploy firmware on the latter. I also plan to deploy x64.

  • package/libs/elfutils 0.189 builds correctly ✅
  • package/libs/elfutils 0.191 not tested yet
  • package/libs/libbpf 1.3.0 builds correctly ✅
  • toolchain/musl 1.2.4 builds correctly ✅
  • toolchain/musl 1.2.5 not tested yet
  • tools/coreutils 9.3 builds correctly ✅
  • tools/coreutils 9.4 not tested yet
  • tools/dwarves 1.26 not tested yet
  • tools/gnulib master builds correctly ✅
  • tools/gnulib stable-202401 not tested yet
  • tools/elfutils 0.189 builds correctly ✅
  • tools/elfutils 0.191 not tested yet
  • tools/libtool 2.4.7 builds correctly ✅
  • toolchain/gcc/initial FAIL ⚠️
  • feeds/packages/lang/perl FAIL ⚠️
  • feeds/packages/net/wavemon FAIL ⚠️

I tried building the main branch, 448b48c on macOS 14.4 (Intel). Indeed it failed. You can find some logs here
https://httpstorm.com/share/.openwrt/test/2024-03-12_xcode-15.3/

Presently we need to fix the following components:

make toolchain/gcc/initial/compile -j 1 V=sc

fails with Xcode 15.3, workaround: revert to Xcode 15.2
https://httpstorm.com/share/.openwrt/test/2024-03-12_xcode-15.3/1043nd.2024-03-12.01-gcc.txt

make package/feeds/packages/perl/{clean,compile} -j 1 V=s

version 5.38.2 fails to build, workaround: revert to 5.28.1
https://httpstorm.com/share/.openwrt/test/2024-03-12_xcode-15.3/1043nd.2024-03-12.02-perl.txt

make package/feeds/packages/wavemon/{clean,compile} -j 1 V=s

version 0.9.5 failed to build for WRT3200ACM, workaround: revert to 0.9.3
I didn't keep that log, and 0.9.5 builds correctly for TP-Link TL-WR1043N/ND v4

The rest builds correctly

make -j 16

https://httpstorm.com/share/.openwrt/test/2024-03-12_xcode-15.3/1043nd.2024-03-12.04-world.txt

@mpratt14
Copy link
Contributor

fails with Xcode 15.3, workaround: revert to Xcode 15.2

so 15.3 is hopeless?
that's the fix not the workaround haha

all I see are headers that fail to include, no fixing that unless we store our own copy

(thanks apple for making a closed source sdk)

@httpstorm
Copy link
Contributor

@mpratt14

fails with Xcode 15.3, workaround: revert to Xcode 15.2

so 15.3 is hopeless? that's the fix not the workaround haha

Finding solutions is much easier when you have a working environment as close to the broken one as possible.
Switching between 15.3 and 15.2 is as easy as renaming a folder. I also have good tools to compare changes.
What I lack is experience with the make system. So any guidance where to begin would be helpful.

all I see are headers that fail to include, no fixing that unless we store our own copy

(thanks apple for making a closed source sdk)

Compatibility had been surprisingly good in the past few years. Though it took a lot of effort to reach that point, and yes they break things every few years. That Apple is highly poisonous.
But then that's the build environment I have and use to contribute to the nice OpenWRT project.
I hope we can make it work again. Nothing is hopeless when the right people work together.

@mpratt14
Copy link
Contributor

sure a patch fix is possible, the real problem is doing it ourselves is "unauthorized" just like how if I somehow downloaded it to my Linux machine that would be an "unauthorized" download

we don't have a build target for xcode, it's just a random prerequisite like the fact that you need make installed

however for a local fix, you can try hunting down the bad header _locale and copying it from 15.2 into 15.3

my main point is that the version release is hopeless not that the entire situation is :P

@guidosarducci
Copy link
Contributor Author

guidosarducci commented Mar 16, 2024

@guidosarducci Hi Tony, I'm sorry for coming late, I just saw this today. Feel free to catch my attention with mail in the future. Let me know of any patches you want tested on macOS and I'll do my best to help you.

I was able to compile for both WRT3200ACM and TL-WR1043N/ND v4. I haven't tested either yet. The first isn't with me at the moment, so I can only deploy firmware on the latter. I also plan to deploy x64.

[...SNIP...]

@httpstorm Thanks Georgi for the offer to test further and sorry myself for the delayed response. I've been trying to build a MacOS container myself on a local build server (using Docker-OSX and your instructions) to recreate the tests but it's been very slow going and honestly quite frustrating. I did find a comment about reusing OpenWrt CI images from @ynezz , but no clue about a pre-built Macos image we can use. I suggest OpenWrt explain how or make one available for just this kind of troubleshooting.

After looking at the CI check logs, I found this description of our MacOS CI image used, which is MacOS 12.7.3 (Monterrey) with Xcode 14.2. Are you able to set up this environment and try building this PR?

In any case, from looking at the CI test logs it's clear there are bugs in our CI processes and/or our tools/toolchain Makefiles, which also affect other PRs.

All the 3 CI check failures are either questionable or just wrong:

  1. For the MacOS tools build, even though this PR updates tools/gnulib and tools/coreutils with toolchain/musl, none of these are being built. This makes errors building tools/elfutils very suspect. If you could build this all locally, Georgi, that would confirm it.
  2. The first problem with the x86_64/generic and malta/be CI builds is that they try to use an external toolchain based on musl 1.2.4 even though this PR uses musl 1.2.5, which would definitely break the build. Even then, code in toolchain/Makefile should recognize the toolchain is being updated and force a rebuild, but this doesn't happen.

I think @nbd168 and @mpratt14 are familiar with toolchain/Makefile so would ping them for comment. And I'm hoping either @ynezz, @hauke or @Ansuel could comment on CI tools/toolchain build specifics or how easiest to reproduce our MacOS CI build.

Hopefully the above can be sorted quickly, then the only remaining hard item blocking this PR is getting openwrt/procd#6 merged.

Thanks again everyone!

@mpratt14
Copy link
Contributor

if you're looking at GitHub logs then I'm not seeing what you're seeing, can you show what logs exactly? or are you seeing that it's still the old gnulib version when it runs?

@guidosarducci
Copy link
Contributor Author

I already uploaded the full logs and specific examples earlier in #14802 (comment).

To download for yourself, the MacOS tools build info is under https://github.com/openwrt/openwrt/actions/runs/8196599103/job/22417156024?pr=14802. Just expand the Upload logs fold to reveal the download link.

@httpstorm
Copy link
Contributor

httpstorm commented Mar 17, 2024

@guidosarducci

In case it is strictly necessary I can try installing macOS 12.7.3, but I'd rather avoid this if possible. It's my only computer.
Would it be feasible to support the current version of macOS 14.4 and Xcode 15.3 in CI? I've never setup or used CI. I'll look into the CI links tomorrow. And also the headers that cause gcc to fail. Whenever I need to build a different architecture or change something major, I always start with a fresh download to avoid issues with leftovers. Virtual disk images are very useful. With my selection of packages, a full build takes around 60 minutes on MBP 2019. Would you be open to collaborate with me on the real hardware?

Current state of branch main 448b48c

  • toolchain/gcc/initial broken since Xcode 15.3 ⚠️
  • toolchain/gcc/final broken since Xcode 15.3 ⚠️
  • feeds/packages/lang/perl 5.38.2 FAIL ⚠️
  • feeds/packages/lang/perl 5.28.1 builds correctly ✅
  • target/linux 6.1.81 x86_64 FAIL ⚠️
  • target/linux 6.1.81 mvebu_cortexa9 builds correctly ✅
  • target/linux 5.15.150 ath79_generic builds correctly ✅

More logs: same link as before.

WRT3200ACM 448b48c (main)
World builds with Xcode 15.3, except for the following packages which fail, but build fine with Xcode 15.2.
These two affect all platforms and should be our primary focus.

make toolchain/gcc/initial/{clean,compile} -j 16
make toolchain/gcc/final/{clean,compile} -j 16

wrt3200acm.2024-03-17.01-world.txt

x64 448b48c (main)
gcc/initial and gcc/final are broken by the changes from Xcode 15.2 to 15.3.
x64.2024-03-17.11-gcc-initial-xcode-15.2.txt
x64.2024-03-17.12-gcc-initial-xcode-15.3.txt
x64.2024-03-17.13-gcc-final-xcode-15.2.txt
x64.2024-03-17.14-gcc-final-xcode-15.3.txt

target/linux is not affected by the Xcode version. TL-WR1043N/ND v4 (5.15.150 ath79_generic) and WRT3200ACM (6.1.81 mvebu_cortexa9) build fine. x64 (6.1.81 x86_64) fails:
x64.2024-03-16.07-linux-xcode-15.2.txt
x64.2024-03-16.08-linux-xcode-15.3.txt

make toolchain/gcc/initial/{clean,compile} -j 1 V=s
make toolchain/gcc/final/{clean,compile} -j 1 V=s
make target/linux/{clean,compile} -j 1 V=s

x64 @guidosarducci master-update-dwarves-elfutils-gnulib
The following packages fail and I cannot proceed past them. They are not affected by the Xcode version.

make tools/elfutils/{clean,compile} -j 1 V=s
make tools/coreutils/{clean,compile} -j 1 V=s

x64.2024-03-16.01-elfutils-0.191.txt
x64.2024-03-16.02-coreutils-9.4.txt

I tried reverting the patches related to these packages, but the old versions which build on main, fail on your branch. I would assume some of the other patches to be the cause.
x64.2024-03-16.03-coreutils-9.3.txt
x64.2024-03-16.04-elfutils-0.189.txt

x64 448b48c (main) comparison: elfutils 0.189 vs 0.191
x64.2024-03-17.01-elfutils-0.189.txt
x64.2024-03-17.02-elfutils-0.191.txt

x64 448b48c (main) comparison: coreutils 9.3 vs 9.4
x64.2024-03-17.03-coreutils-9.3.txt
x64.2024-03-17.04-coreutils-9.4.txt

coreutils 9.3 9.4 and elfutils 0.189 0.191 build directories
x64.2024-03-17.15-host.tar.bz2

coreutils-9.4 are already installed on the host macOS, which means the brew team compiled them successfully.
I can also extract and compile them manually

cd /Volumes/x64/tools
tar xvf /Volumes/x64/openwrt/dl/coreutils-9.4.tar.xz
cd coreutils-9.4
./configure
make -j 16

x64.2024-03-17.05-coreutils-9.3-host.txt
x64.2024-03-17.06-coreutils-9.4-host.txt

@robimarko robimarko force-pushed the master-update-dwarves-elfutils-gnulib branch from 2d17547 to c514051 Compare April 25, 2024 19:14
@robimarko
Copy link
Contributor

GH changed their images to macOS 14 and ARM64, so lets see if our CI fails

mpratt14 and others added 15 commits April 25, 2024 21:33
A funny bug was discovered where if the buildroot's path
has the name of the build target within it, it will also be substituted
along with the stampfile's name for each program,
causing an attempt to touch a file in a directory that doesn't exist.

...
...
touch: cannot touch '/Volumes/touch/openwrt/staging_dir/host/stamp/.touch_installed': No such file or directory
touch: cannot touch '/Volumes/ln/openwrt/staging_dir/host/stamp/.ln_installed': No such file or directory
touch: cannot touch '/Volumes/chown/openwrt/staging_dir/host/stamp/.chown_installed': No such file or directory
make[2]: *** [Makefile:50: /Volumes/coreutils/openwrt/staging_dir/host/stamp/.coreutils_installed] Error 1
...
...

Split up the path with $(dir) and $(notdir) before substitution to fix
the syntax.

Reported-by: Georgi Valkov <gvalkov@gmail.com>
Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
There are other wrapper scripts released with makeinfo like texi2pdf which
are required by the build prerequisites of some tools, and have a similar
purpose and usage.

Let the makeinfo perl script handle all of these cases.

It's worth mentioning that "texi2any" is the actual program and "makeinfo"
is one of it's aliases. From upstream GNU:

  makeinfo: texi2any
	rm -f $@
	-$(LN_S) texi2any $@

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Patches refreshed automatically.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
For modules that depend on the reallocarray module, like ialloc, xalloc,
and safe-alloc, it was not possible to skip importing the reallocarray
module as they all contained at least one function that called
reallocarray() and would cause build failure if the host system didn't
declare it.

This upstreamable patch adds macros that toggle whether to define
functions that depend on reallocarray() based on whether the reallocarray
module is being imported.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
The tdestroy() function, which is a GNU extension to the standard C
library, is defined in gnulib in tsearch.c but is missing it's
corresponding declaration in search.in.h by being completely missing...

This patch is large but upstreamable, including all of the macros and
conditionals and configure checks that upstream GNU would expect for
portable support, like using the @@ placeholder/substitution method to
determine whether or not to have declarations based on whether or not
tdestroy() is already declared within the standard headers of the default
include paths.

There were also some typedefs and aliases missing, along with the warnings
and preprocessor exceptions that need to be added for consistency with the
usage of the rest of the functions in the files.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Release Announcement:
https://savannah.gnu.org/news/?group_id=425

Refresh:
- 200-libunistring-missing-link.patch

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Force bison to ignore the M4 environment variable and hardcode it to the
locally built m4 during build operations using the relocatable path
variable STAGING_DIR_HOST.

This allows bison to continue to function while we are forcefully avoiding
autoreconf and other autoconf and automake-like operations by giving a
fake path to m4 with the M4 environment variable.

The specific path can still be overridden independently from the
environment within the line of invocation that runs bison by setting
STAGING_DIR_HOST within the command, so document this in the help printout.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Update to latest stable release.

Add configure option to disable support for the Year 2038 problem.
(for now, as some versions of GCC do not yet support it)

Syncing bootstrap script fails, backport an upstream patch which can be
removed at next coreutils update.

Several headers from the stable gnulib branch cause build failure because
the changes in the imported versions are incompatible with the Makefile
that gets generated for coreutils. This version of coreutils was released
after being bootstrapped and autoreconf'ed with a significantly different
version of gnulib compared to our local gnulib, so skip importing them
(and restore the backup).

While at it, organize restoring the originally shipped version of files
into a Make foreach function.

Refresh patch:
- 000-bootstrap.patch

New patch:
- 001-bootstrap-sync.patch

Link: https://lists.gnu.org/archive/html/coreutils/2023-08/msg00099.html
Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Update to latest stable release.

The following commits in gnulib caused a conflict in locally bootstrapped
coreutils with stable gnulib:

  8f4b4e52c991de2233b471f8e35a068866b31f01
  2749234203959df8d72cd8638d4e00a9fff450db

A module (strftime) was marked deprecated and replaced by another module
(nstrftime) in the version of gnulib that coreutils was released with
compared to the stable branch that we use for importing. Conflicts from
the previous version of coreutils are now gone, so other imported headers
are now good.

Refresh patch:
 - 000-bootstrap.patch

Remove upstreamed patch:
 - 001-bootstrap-sync.patch

Link: https://lists.gnu.org/archive/html/coreutils/2024-03/msg00132.html
Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Release Notes:
https://sourceware.org/pipermail/elfutils-devel/2024q1/006876.html

Manually refresh:
- 100-portability.patch

Change:
- replace libgen.h with gnulib "dirname" module for compilation errors:
    In file included from ./../libdw/libdwP.h:38,
                     from eblobjnote.c:42:
    /usr/include/libgen.h:35:9: error: attempt to use poisoned "basename"
       35 | #define basename        __xpg_basename
          |         ^

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Co-Developed-by: Nick Hainke <vincent@systemli.org>
Signed-off-by: Nick Hainke <vincent@systemli.org>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Instead of editing the SUBDIRS variable with a patch, it can be overriden
at the end of the command line when invoking Make.

This tool has a series of recursive Makefiles in each subdirectory,
therefore SUBDIRS is set to a pattern of Make functions so that the result
is variable depending on the current subdirectory that Make is being
invoked in.

It's not necessary to have gnulib-cache.m4 in EXTRA_DIST since we don't
need to re-import after packaging this in the SDK, so get rid of the
entire patch hunk for ./Makefile.am

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Organize the Makefile lines involved in gnulib importing and its
workarounds. It improves readability and keeps git history organized.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
On macOS, stdlib.h in the standard include paths does not provide
reallocarray() while both elfutils and gnulib do, however they are
declared differently, leading to an error:

  ./system.h:101:1: error: static declaration of 'reallocarray' follows non-static declaration
  reallocarray (void *ptr, size_t nmemb, size_t size)

A normal "configure && make" build cycle results in both declarations
being enabled as a result of both elfutils and gnulib having completely
separate configure checks where gnulib uses an internal placeholder symbol
HAVE_REALLOCARRAY, and elfutils uses a standard autoconf macro
HAVE_DECL_REALLOCARRAY.

Fix this by excluding the import of the reallocarray module which causes
gnulib checks in the configure stage to not even consider whether to
declare reallocarray later on, so the decision is only between the
standard include stdlib.h and the elfutils header.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
A false tdestroy() function was added in order to make elfutils build on
macOS again. A previous commit added declarations for a real version of
tdestroy() into gnulib, which is already imported, as well as the
preprocessor flags and the triggers for the Makefile.am conditional in
order to include the source to be built.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Quilt refresh combined two sets of changes to the same file.

The switch from using libgen.h to dirname.h because of function poisoning
from gnulib's import of basename() was added as a new patch hunk instead
of an edit to the original one.

The original patch hunk was to fix build errors on an earlier version of
elfutils before the "dirname" module was being imported to fix further
build errors with the 0.191 version.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
@robimarko robimarko force-pushed the master-update-dwarves-elfutils-gnulib branch from c514051 to 1991bfb Compare April 25, 2024 19:33
@openwrt-bot openwrt-bot merged commit 1991bfb into openwrt:main Apr 25, 2024
14 checks passed
@robimarko
Copy link
Contributor

I am counting on follow-up patches if required :)

@guidosarducci guidosarducci deleted the master-update-dwarves-elfutils-gnulib branch April 26, 2024 00:25
@guidosarducci
Copy link
Contributor Author

@robimarko Thanks for tackling this; we'll keep fingers crossed but hopefully not necessary after the time spent working on it. Could I trouble you to check on #15215 as well? That 6.6 update has been stalled for a month...

@robimarko
Copy link
Contributor

@guidosarducci The discussion in it is still active

@mpratt14
Copy link
Contributor

@robimarko he's referring to the initial PR for that being stale which made him make this new one (referenced in the initial comment)

@robimarko
Copy link
Contributor

@mpratt14 Well, that wasn't really clear to me.

It is probably just a lack of people interested in that target

@trippleflux
Copy link

Getting :

/usr/bin/ld: /home/username/works/openwrt/staging_dir/host/lib/libelf.a(xmalloc.o): in function `xmalloc':
xmalloc.c:(.text+0x0): multiple definition of `xmalloc'; /home/username/works/openwrt/staging_dir/host/lib/libelf.a(libgnu_la-xmalloc.o):xmalloc.c:(.text+0x0): first defined here
/usr/bin/ld: /home/username/works/openwrt/staging_dir/host/lib/libelf.a(xmalloc.o): in function `xcalloc':
xmalloc.c:(.text+0x30): multiple definition of `xcalloc'; /home/username/works/openwrt/staging_dir/host/lib/libelf.a(libgnu_la-xmalloc.o):xmalloc.c:(.text+0x180): first defined here
/usr/bin/ld: /home/username/works/openwrt/staging_dir/host/lib/libelf.a(xmalloc.o): in function `xrealloc':
xmalloc.c:(.text+0x60): multiple definition of `xrealloc'; /home/username/works/openwrt/staging_dir/host/lib/libelf.a(libgnu_la-xmalloc.o):xmalloc.c:(.text+0x40): first defined here
/usr/bin/ld: /home/username/works/openwrt/staging_dir/host/lib/libelf.a(xstrdup.o): in function `xstrdup':
xstrdup.c:(.text+0x0): multiple definition of `xstrdup'; /home/username/works/openwrt/staging_dir/host/lib/libelf.a(libgnu_la-xmalloc.o):xmalloc.c:(.text+0x270): first defined here
collect2: error: ld returned 1 exit status

When trying to compiling net/frr, does anyone have a clue?. Never happened before this elfutils upgrade.

Have reported in here .

@robimarko
Copy link
Contributor

Did you rebuild the tools and toolchain?

@trippleflux
Copy link

Yes, twice, the last one is deleting all of the OpenWrt related directories and redo it again.

The temporary ugly and really bad solution for now is adding "-Wl,--allow-multiple-definition" into frr cflags.

@mpratt14
Copy link
Contributor

I'm going to try to handle this today if I have the time

and by the way, this is actually a side effect of some of the hacky things Felix did in the Makefile.am files for elfutils, and not actually gnulib's fault for once

@robimarko
Copy link
Contributor

@mpratt14 We have been bisecting it, so please join us:
openwrt/packages#24030

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build/scripts/tools pull request/issues for build, scripts and tools related changes core packages pull request/issue for core (in-tree) packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants