-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[BUG] Linux Chip-tool GCC and Chip-tool clang do not link the same Logging implementation #30633
Comments
I think we are not allowed to try to add extra dependencies top level to "override". Instead if seems pigweed defines global |
IIRC I added the An alternative would be for those tools to install a logging redirection callback to copy messages to stderr instead of replacing the backend. IIRC I looked at that but didn't do it at the time because it would then cause double logging on Linux where the default backend already logs to stdio. Maybe we could make the redirection approach work if we expose some sort of "LogVIsStdio" flag so we can not install the redirection callback in that case. |
Actually I'm a bit hazy on exactly what the stumbling block for using the redirection approach was... It might have been unit tests where there wasn't necessarily a clean place to set up the redirection. I think for platforms like Linux or Darwin the question is really where the best place is to decide whether or not logging should go to stdio (in addition to a system logging backend), it doesn't seem correct for a library to just log to stderr -- though of course we're not actually shipping any pre-built static or dynamic libraries directly out of the SDK source at this point. Tangentially related, for |
Reproduction steps
By building chip-tool with clang on my raspi I noticed the logs had no timestamps
./scripts/build/build_examples.py --target linux-arm64-chip-tool-ipv6only-clang build
with GCC, timestamps are present.
./scripts/build/build_examples.py --target linux-arm64-chip-tool-ipv6only build
When built with clang,
src/platform/logging/impl/stdio/Logging.cpp
is used/linked.when GCC is used,
src/platform/Linux/Logging.cpp
is used/linked.While
src/platform/Linux/Logging.cpp
should always be used in this case, this is not the only problem.Both
LogV
functions seem compiled, the same symbol is defined twice and the linker doesn't throw an error.A quick test @andy31415 and I did:
src/platform/logging/impl/stdio/Logging.cpp
(CLANG),src/platform/Linux/Logging.cpp
(GCC)mapfiles.zip
The issue might be linked with #23528
Bug prevalence
Always
GitHub hash of the SDK that was being used
6b91619
Platform
raspi, other
Platform Version(s)
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: