Skip to content

CFE-2780: Fixed warnings from autoreconf #5830

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

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

larsewi
Copy link
Contributor

@larsewi larsewi commented Jun 23, 2025

Ticket: CFE-2780

$ NO_CONFIGURE=1 ./autogen.sh 
./autogen.sh: Running determine-version.sh ...
./autogen.sh: Running autoreconf ...
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:147: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:147: You should run autoupdate.
./lib/autoconf/c.m4:72: AC_LANG_C is expanded from...
m4/acinclude.m4:3: ACX_PTHREAD is expanded from...
configure.ac:147: the top level
configure.ac:147: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:147: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
m4/acinclude.m4:3: ACX_PTHREAD is expanded from...
configure.ac:147: the top level
configure.ac:93: installing './compile'
configure.ac:55: installing './missing'
libcompat/Makefile.am: installing './depcomp'
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:177: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:177: You should run autoupdate.
./lib/autoconf/c.m4:72: AC_LANG_C is expanded from...
m4/acinclude.m4:3: ACX_PTHREAD is expanded from...
configure.ac:177: the top level
configure.ac:177: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:177: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
m4/acinclude.m4:3: ACX_PTHREAD is expanded from...
configure.ac:177: the top level
configure.ac:122: installing './compile'
configure.ac:72: installing './missing'
cf-agent/Makefile.am: installing './depcomp'
tests/acceptance/Makefile.am:103: warning: wildcard [0-9]*: non-POSIX variable name
tests/acceptance/Makefile.am:103: (probably a GNU make extension)

The warning: The macro 'AC_LANG_C' is obsolete and warning: The macro 'AC_TRY_LINK' is obsolete comes from deprecated ACX_PTHREAD. You should use AX_PTHREAD instead, but it does not work when cross-compiling for MinGW. So this warning is there to stay.

The warning: wildcard [0-9]*: non-POSIX variable name we can fix. But it means that we have to statically list all the acceptance tests in the EXTRA_DIST variable. Reason being that the wildcard function is a GNU extension in make. I'm not sure if it's worth it having to maintain this list of acceptance tests to remove this one warning.

@cf-bottom
Copy link

Thanks for submitting a PR! Maybe @craigcomstock can review this?

larsewi added 10 commits June 26, 2025 15:05
This way we don't get annoying warnings like:

```
warning: source file '$(srcdir)/../../libutils/statistics.c' is in a subdirectory,
but option 'subdir-objects' is disabled
```

Ticket: CFE-2780
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: CFE-2780
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: CFE-2780
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: CFE-2780
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Looks like 520144f was an attempt to
fix init_script_test_helper from not being cleaned properly. This commit
was reverted in ebd97bd, and another
attempt was added in 9dc759f. However,
the revert actually removed the entire `init_script_test_helper` binary
from being compiled. This reapplying the first fix, and combining it
with the second fix should do the trick.

Found this while trying to clear the warning:
```
tests/unit/Makefile.am:402: warning: variable 'init_script_test_helper_SOURCES' is defined but no program or
tests/unit/Makefile.am:402: library has 'init_script_test_helper' as canonical name (possible typo)
```

This reverts commit ebd97bd.
I don't know why, but this was necessary, and all the other tests does
this. I was getting the following errors after enabling subdir-objects
in `AM_INIT_AUTOMAKE`:

```
Makefile:1843: ../../cf-upgrade/.deps/cf_upgrade_test-alloc-mini.Po: No such file or directory
Makefile:1844: ../../cf-upgrade/.deps/cf_upgrade_test-command_line.Po: No such file or directory
Makefile:1845: ../../cf-upgrade/.deps/cf_upgrade_test-configuration.Po: No such file or directory
Makefile:1846: ../../cf-upgrade/.deps/cf_upgrade_test-log.Po: No such file or directory
Makefile:1847: ../../cf-upgrade/.deps/cf_upgrade_test-process.Po: No such file or directory
Makefile:1848: ../../cf-upgrade/.deps/cf_upgrade_test-update.Po: No such file or directory
```

Ticket: CFE-2780
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
The `init_script_test_helper` binary does not require any libraries.
The libraries `libpromises.la` and `libtest.la` were previously added
through the `LDADD` variable in the top of Makefile.am.

Ticket: CFE-2780
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
For some reason it causes the following error

```
10:58:19 Makefile:598: ../../libpromises/.deps/lastseen.Po: No such file or directory
10:58:19 make[3]: *** No rule to make target '../../libpromises/.deps/lastseen.Po'.  Stop.
```

in bootstrap_pr while doing `make dist` in Jenkins.

Ticket: CFE-2780
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Building stuff from libutils in test/unit causes make distclean to
delete the same files twice resulting in failure. This happens as an
effect of enabling subdir-objects which causes recursive builds.

Ticket: CFE-2780
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Ticket: CFE-2780
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Now that we link with libpromises we no longer have to declare this
here.

```
==45622==ERROR: AddressSanitizer: odr-violation (0x55c3e03d9d40):
  [1] size=1024 'VFQNAME' logging_test.c:11:6 in /home/runner/work/core/core/tests/unit/.libs/logging_test
  [2] size=1024 'VFQNAME' cf3globals.c:64:6 in /home/runner/work/core/core/libpromises/.libs/libpromises.so.3
These globals were registered at these points:
  [1]:
    #0 0x7f770c85306f in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:350
    #1 0x55c3e03c776f in _sub_I_00099_1 (/home/runner/work/core/core/tests/unit/.libs/logging_test+0x676f) (BuildId: 7031c26309619108a56e4f80219ce2a3f7dc0d53)
    #2 0x7f770b02a303 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a303) (BuildId: 42c84c92e6f98126b3e2230ebfdead22c235b667)
    cfengine#3 0x55c3e03c67a4 in _start (/home/runner/work/core/core/tests/unit/.libs/logging_test+0x57a4) (BuildId: 7031c26309619108a56e4f80219ce2a3f7dc0d53)

  [2]:
    #0 0x7f770c85306f in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:350
    #1 0x7f770c32b055 in _sub_I_00099_1 (/home/runner/work/core/core/libpromises/.libs/libpromises.so.3+0x12b055) (BuildId: e23104812e7f54cae9a78b25a00d6f00861edf79)
    #2 0x7f770cfe471e  (/lib64/ld-linux-x86-64.so.2+0x571e) (BuildId: 1c8db5f83bba514f8fd5f1fb6d7be975be1bb855)
    cfengine#3 0x7f770cfe4823  (/lib64/ld-linux-x86-64.so.2+0x5823) (BuildId: 1c8db5f83bba514f8fd5f1fb6d7be975be1bb855)
    cfengine#4 0x7f770cffe59f  (/lib64/ld-linux-x86-64.so.2+0x1f59f) (BuildId: 1c8db5f83bba514f8fd5f1fb6d7be975be1bb855)

==45622==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
SUMMARY: AddressSanitizer: odr-violation: global 'VFQNAME' at logging_test.c:11:6 in /home/runner/work/core/core/tests/unit/.libs/logging_test
==45622==ABORTING
FAIL: logging_test
```

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
@larsewi
Copy link
Contributor Author

larsewi commented Jun 30, 2025

@cf-bottom Jenkins please :)

@cf-bottom
Copy link

cf-bottom commented Jun 30, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants