<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/NetworkManager.git/m4, branch lr/asserts</title>
<subtitle>gitlab.freedesktop.org: NetworkManager/NetworkManager.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/'/>
<entry>
<title>build: rework libreadline detection in autotools</title>
<updated>2021-07-19T07:08:06+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2021-07-15T08:27:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=bf86f51c9e5a0afd1f5f0ef3cd7e9947ea329fd2'/>
<id>bf86f51c9e5a0afd1f5f0ef3cd7e9947ea329fd2</id>
<content type='text'>
- `m4/ax_lib_readline.m4` was already aware of "$with_readline".
  Move the entire handling of the parameter inside the AX_LIB_READLINE
  macro.
  This lets our fork of ax_lib_readline.m4 further deviate from upstream
  version, but it's already so different that this is no new problem.

- raise an error if the user requested --with-readline=libreadline|libedit
  but the library was not found.

- only allow yes|no for --with-nmcli argument. But still default to
  "yes", which will always require one libreadline library to be
  detected. In particular, don't automatically disable nmcli if
  libreadline is not available, because building without nmcli
  should be an explicit choice. That is like before.

- update the "$with_readline" variable for the "auto" case to reflect
  what was detected.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- `m4/ax_lib_readline.m4` was already aware of "$with_readline".
  Move the entire handling of the parameter inside the AX_LIB_READLINE
  macro.
  This lets our fork of ax_lib_readline.m4 further deviate from upstream
  version, but it's already so different that this is no new problem.

- raise an error if the user requested --with-readline=libreadline|libedit
  but the library was not found.

- only allow yes|no for --with-nmcli argument. But still default to
  "yes", which will always require one libreadline library to be
  detected. In particular, don't automatically disable nmcli if
  libreadline is not available, because building without nmcli
  should be an explicit choice. That is like before.

- update the "$with_readline" variable for the "auto" case to reflect
  what was detected.
</pre>
</div>
</content>
</entry>
<entry>
<title>m4: cli: Add support for --with-readline=auto|libreadline|libedit|none configuration options</title>
<updated>2021-07-14T15:16:45+00:00</updated>
<author>
<name>Lukasz Majewski</name>
<email>lukma@denx.de</email>
</author>
<published>2021-07-01T13:47:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=8ea9da85b3934c9258d8e2900d5706ebf933f8f1'/>
<id>8ea9da85b3934c9258d8e2900d5706ebf933f8f1</id>
<content type='text'>
This commit provides support for --with-readline=auto|libreadline|libedit|none option
for the configure script.

It allows building the NetworkManager's nmcli tool with libedit instead
of libreadline.

With --with-readline=auto the system looks for any eligible readline library
to use.

Moreover, in this commit all required defines are provided (e.g.
HAVE_EDITLINE_READLINE) to allow correct buil of the code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit provides support for --with-readline=auto|libreadline|libedit|none option
for the configure script.

It allows building the NetworkManager's nmcli tool with libedit instead
of libreadline.

With --with-readline=auto the system looks for any eligible readline library
to use.

Moreover, in this commit all required defines are provided (e.g.
HAVE_EDITLINE_READLINE) to allow correct buil of the code.
</pre>
</div>
</content>
</entry>
<entry>
<title>m4: Check for history_set_history_state instead of add_history</title>
<updated>2021-07-14T15:16:45+00:00</updated>
<author>
<name>Lukasz Majewski</name>
<email>lukma@denx.de</email>
</author>
<published>2021-07-01T14:00:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=0c5adc6938447cdec62c599fe58fe48b27e1a986'/>
<id>0c5adc6938447cdec62c599fe58fe48b27e1a986</id>
<content type='text'>
The add_history function is available on both - libreadline and libedit.

The read difference between those two libraries is that for libedit the
history_set_history_state is missing.
On that basis one can assess if we do have history from libreadline or
from libedit.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The add_history function is available on both - libreadline and libedit.

The read difference between those two libraries is that for libedit the
history_set_history_state is missing.
On that basis one can assess if we do have history from libreadline or
from libedit.
</pre>
</div>
</content>
</entry>
<entry>
<title>m4: ax_lib_readline.m4: Use readline libraries when linking add_history test program</title>
<updated>2021-07-14T15:16:45+00:00</updated>
<author>
<name>Lukasz Majewski</name>
<email>lukma@denx.de</email>
</author>
<published>2021-03-12T18:37:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=552e00990d9c61b3a364bd0b773047ce4c277ac4'/>
<id>552e00990d9c61b3a364bd0b773047ce4c277ac4</id>
<content type='text'>
Up till now the AC_LANG_CALL() was just checking if program which
uses the add_history call can be correctly linked without passing
required libraries (e.g. -libreadline to LIBS variable).

This commit fixes this issue as now the add_history can be found as it
is now available in any of passed libs.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Up till now the AC_LANG_CALL() was just checking if program which
uses the add_history call can be correctly linked without passing
required libraries (e.g. -libreadline to LIBS variable).

This commit fixes this issue as now the add_history can be found as it
is now available in any of passed libs.
</pre>
</div>
</content>
</entry>
<entry>
<title>m4: fix readline macro</title>
<updated>2021-04-27T08:33:59+00:00</updated>
<author>
<name>Beniamino Galvani</name>
<email>bgalvani@redhat.com</email>
</author>
<published>2021-04-23T11:56:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=b9929b647b708441ea823e961049d86e4562753d'/>
<id>b9929b647b708441ea823e961049d86e4562753d</id>
<content type='text'>
The macro always overwrites LIBS and the result is that every binary
links against libreadline.

Instead, save the library to READLINE_LIBS.

See also: 94274c6fcdc7 ('build: fix wrongly linking against libreadline in all applications')

Fixes: af360238be19 ('m4/ax_lib_readline.m4: Update after running aclocal')
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The macro always overwrites LIBS and the result is that every binary
links against libreadline.

Instead, save the library to READLINE_LIBS.

See also: 94274c6fcdc7 ('build: fix wrongly linking against libreadline in all applications')

Fixes: af360238be19 ('m4/ax_lib_readline.m4: Update after running aclocal')
</pre>
</div>
</content>
</entry>
<entry>
<title>m4/ax_lib_readline.m4: Update after running aclocal</title>
<updated>2021-04-07T07:17:17+00:00</updated>
<author>
<name>Javier Jardón</name>
<email>jjardon@gnome.org</email>
</author>
<published>2021-03-31T08:53:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=af360238be198257934b89d42f24431401550721'/>
<id>af360238be198257934b89d42f24431401550721</id>
<content type='text'>
See-also: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/796
See-also: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/807
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See-also: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/796
See-also: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/807
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: fix undefined references to pthread</title>
<updated>2021-04-07T06:29:50+00:00</updated>
<author>
<name>orbea</name>
<email>orbea@riseup.net</email>
</author>
<published>2021-04-02T00:47:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=3affccf29b53976a0cef5ea662f913d4913d44c8'/>
<id>3affccf29b53976a0cef5ea662f913d4913d44c8</id>
<content type='text'>
When building NetworkManger with --enable-tests or using 'make check'
and slibtool the build will fail in many places with undefined references
to pthreads.

This is because -lpthread is never explicitly added to the appropriate
variable, src_core_libNetworkManagerTest_la_LIBADD. When analyzing the
build log with GNU libtool it can be seen that it silently adds -pthread
on its own which hides the issue.

To solve this ax_pthread.m4 from the autoconf-archives project can be
used which provides the $(PTHREAD_LIBS) linker flag.

Source: https://github.com/autoconf-archive/autoconf-archive/blob/master/m4/ax_pthread.m4
See-also: https://www.gnu.org/software/autoconf-archive/ax_pthread.html

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/804
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When building NetworkManger with --enable-tests or using 'make check'
and slibtool the build will fail in many places with undefined references
to pthreads.

This is because -lpthread is never explicitly added to the appropriate
variable, src_core_libNetworkManagerTest_la_LIBADD. When analyzing the
build log with GNU libtool it can be seen that it silently adds -pthread
on its own which hides the issue.

To solve this ax_pthread.m4 from the autoconf-archives project can be
used which provides the $(PTHREAD_LIBS) linker flag.

Source: https://github.com/autoconf-archive/autoconf-archive/blob/master/m4/ax_pthread.m4
See-also: https://www.gnu.org/software/autoconf-archive/ax_pthread.html

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/804
</pre>
</div>
</content>
</entry>
<entry>
<title>build: add comment for disabling "-Wmaybe-uninitialized" with LTO</title>
<updated>2021-01-08T11:36:55+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2021-01-08T10:18:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=89f808efcb76621f5bf8696fa823bf5955612a64'/>
<id>89f808efcb76621f5bf8696fa823bf5955612a64</id>
<content type='text'>
With LTO it's easy to get "-Wmaybe-uninitialized" false positives.
But the warning is useful, we we don't want to disable it altogether.

However, while investigating the problem it can be useful to patch
it temporarily. Add a code comment that suggests how to do that.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With LTO it's easy to get "-Wmaybe-uninitialized" false positives.
But the warning is useful, we we don't want to disable it altogether.

However, while investigating the problem it can be useful to patch
it temporarily. Add a code comment that suggests how to do that.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "build: set CFLAGS "-Wno-error=maybe-uninitialized" with LTO build"</title>
<updated>2021-01-08T11:36:23+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2021-01-08T11:36:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=cd5792a2b3cfa208963a9aaa9181ff95e8d61c8d'/>
<id>cd5792a2b3cfa208963a9aaa9181ff95e8d61c8d</id>
<content type='text'>
This was not intended to be pushed to master. Sorry.

This reverts commit 1d63271a8d3d29f97d4c5d11eff1c5edc4e79874.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was not intended to be pushed to master. Sorry.

This reverts commit 1d63271a8d3d29f97d4c5d11eff1c5edc4e79874.
</pre>
</div>
</content>
</entry>
<entry>
<title>build: set CFLAGS "-Wno-error=maybe-uninitialized" with LTO build</title>
<updated>2021-01-08T11:17:58+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2021-01-08T10:18:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=1d63271a8d3d29f97d4c5d11eff1c5edc4e79874'/>
<id>1d63271a8d3d29f97d4c5d11eff1c5edc4e79874</id>
<content type='text'>
With LTO builds we get "-Wmaybe-uninitialized" warnings, which break
the build.

These seem false positives to me, due to aggressive inlining. But also
suppressing them with a pragma does not work. So, make them non-fatal
altogether. That is unfortunate, because this warning would be useful
to catch bugs.

Interestingly, when building --with-more-asserts, then the build passes
without warning. Probably because then the inlining doesn't happen.

    libtool: link: gcc -Wall -Werror -Wno-stringop-overflow -Wextra -Wdeclaration-after-statement -Wfloat-equal -Wformat-nonliteral -Wformat-security -Wimplicit-function-declaration -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wpointer-arith -Wshadow -Wshift-negative-value -Wstrict-prototypes -Wundef -Wvla -Wno-duplicate-decl-specifier -Wno-format-truncation -Wno-format-y2k -Wno-missing-field-initializers -Wno-pragmas -Wno-sign-compare -Wno-unknown-pragmas -Wno-unused-parameter -Wno-array-bounds -Wunused-value -Wcast-function-type -Wimplicit-fallthrough -fno-strict-aliasing -fdata-sections -ffunction-sections -Wl,--gc-sections -flto -flto-partition=none -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o src/platform/tests/test-platform-general src/platform/tests/test_platform_general-test-platform-general.o  src/.libs/libNetworkManagerTest.a -luuid -lgnutls -lsystemd -lndp -lselinux -L/lib64 -laudit -lpsl -lcurl -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -ludev -ldl -pthread
    src/platform/nm-linux-platform.c: In function 'ip_route_add':
    src/platform/nm-platform.c:4761:24: error: 'MEM[(struct NMPlatformIPRoute *)&amp;obj + 24B].rt_source' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4761 |     route-&gt;rt_source = nmp_utils_ip_config_source_round_trip_rtprot(route-&gt;rt_source);
          |                        ^
    src/platform/nm-platform.h:2139:25: error: 'BIT_FIELD_REF &lt;MEM[(const struct NMPlatformIPRoute *)&amp;obj + 24B], 8, 72&gt;' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2139 |     return r-&gt;table_any ? 254u /* RT_TABLE_MAIN */
          |                         ^
    lto1: all warnings being treated as errors
    lto-wrapper: fatal error: gcc returned 1 exit status
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With LTO builds we get "-Wmaybe-uninitialized" warnings, which break
the build.

These seem false positives to me, due to aggressive inlining. But also
suppressing them with a pragma does not work. So, make them non-fatal
altogether. That is unfortunate, because this warning would be useful
to catch bugs.

Interestingly, when building --with-more-asserts, then the build passes
without warning. Probably because then the inlining doesn't happen.

    libtool: link: gcc -Wall -Werror -Wno-stringop-overflow -Wextra -Wdeclaration-after-statement -Wfloat-equal -Wformat-nonliteral -Wformat-security -Wimplicit-function-declaration -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wpointer-arith -Wshadow -Wshift-negative-value -Wstrict-prototypes -Wundef -Wvla -Wno-duplicate-decl-specifier -Wno-format-truncation -Wno-format-y2k -Wno-missing-field-initializers -Wno-pragmas -Wno-sign-compare -Wno-unknown-pragmas -Wno-unused-parameter -Wno-array-bounds -Wunused-value -Wcast-function-type -Wimplicit-fallthrough -fno-strict-aliasing -fdata-sections -ffunction-sections -Wl,--gc-sections -flto -flto-partition=none -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o src/platform/tests/test-platform-general src/platform/tests/test_platform_general-test-platform-general.o  src/.libs/libNetworkManagerTest.a -luuid -lgnutls -lsystemd -lndp -lselinux -L/lib64 -laudit -lpsl -lcurl -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -ludev -ldl -pthread
    src/platform/nm-linux-platform.c: In function 'ip_route_add':
    src/platform/nm-platform.c:4761:24: error: 'MEM[(struct NMPlatformIPRoute *)&amp;obj + 24B].rt_source' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4761 |     route-&gt;rt_source = nmp_utils_ip_config_source_round_trip_rtprot(route-&gt;rt_source);
          |                        ^
    src/platform/nm-platform.h:2139:25: error: 'BIT_FIELD_REF &lt;MEM[(const struct NMPlatformIPRoute *)&amp;obj + 24B], 8, 72&gt;' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2139 |     return r-&gt;table_any ? 254u /* RT_TABLE_MAIN */
          |                         ^
    lto1: all warnings being treated as errors
    lto-wrapper: fatal error: gcc returned 1 exit status
</pre>
</div>
</content>
</entry>
</feed>
