* [PATCH iproute2-next] configure: Allow command line override of toolchain
@ 2022-02-28 1:54 David Ahern
2022-02-28 17:11 ` Stephen Hemminger
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: David Ahern @ 2022-02-28 1:54 UTC (permalink / raw)
To: netdev; +Cc: stephen, David Ahern
Easy way to build for both gcc and clang.
Signed-off-by: David Ahern <dsahern@kernel.org>
---
configure | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/configure b/configure
index 8ddff43c6a7d..13f2d1739b99 100755
--- a/configure
+++ b/configure
@@ -19,10 +19,10 @@ check_toolchain()
: ${AR=ar}
: ${CC=gcc}
: ${YACC=bison}
- echo "PKG_CONFIG:=${PKG_CONFIG}" >>$CONFIG
- echo "AR:=${AR}" >>$CONFIG
- echo "CC:=${CC}" >>$CONFIG
- echo "YACC:=${YACC}" >>$CONFIG
+ echo "PKG_CONFIG?=${PKG_CONFIG}" >>$CONFIG
+ echo "AR?=${AR}" >>$CONFIG
+ echo "CC?=${CC}" >>$CONFIG
+ echo "YACC?=${YACC}" >>$CONFIG
}
check_atm()
--
2.24.3 (Apple Git-128)
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH iproute2-next] configure: Allow command line override of toolchain
2022-02-28 1:54 [PATCH iproute2-next] configure: Allow command line override of toolchain David Ahern
@ 2022-02-28 17:11 ` Stephen Hemminger
2022-02-28 17:50 ` patchwork-bot+netdevbpf
2022-03-02 13:56 ` Ido Schimmel
2 siblings, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2022-02-28 17:11 UTC (permalink / raw)
To: David Ahern; +Cc: netdev
On Sun, 27 Feb 2022 18:54:35 -0700
David Ahern <dsahern@kernel.org> wrote:
> Easy way to build for both gcc and clang.
>
> Signed-off-by: David Ahern <dsahern@kernel.org>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH iproute2-next] configure: Allow command line override of toolchain
2022-02-28 1:54 [PATCH iproute2-next] configure: Allow command line override of toolchain David Ahern
2022-02-28 17:11 ` Stephen Hemminger
@ 2022-02-28 17:50 ` patchwork-bot+netdevbpf
2022-03-02 13:56 ` Ido Schimmel
2 siblings, 0 replies; 9+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-02-28 17:50 UTC (permalink / raw)
To: David Ahern; +Cc: netdev, stephen
Hello:
This patch was applied to iproute2/iproute2-next.git (main)
by David Ahern <dsahern@kernel.org>:
On Sun, 27 Feb 2022 18:54:35 -0700 you wrote:
> Easy way to build for both gcc and clang.
>
> Signed-off-by: David Ahern <dsahern@kernel.org>
> ---
> configure | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Here is the summary with links:
- [iproute2-next] configure: Allow command line override of toolchain
https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=386ae64c8312
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH iproute2-next] configure: Allow command line override of toolchain
2022-02-28 1:54 [PATCH iproute2-next] configure: Allow command line override of toolchain David Ahern
2022-02-28 17:11 ` Stephen Hemminger
2022-02-28 17:50 ` patchwork-bot+netdevbpf
@ 2022-03-02 13:56 ` Ido Schimmel
2022-03-05 18:11 ` David Ahern
2 siblings, 1 reply; 9+ messages in thread
From: Ido Schimmel @ 2022-03-02 13:56 UTC (permalink / raw)
To: David Ahern; +Cc: netdev, stephen
On Sun, Feb 27, 2022 at 06:54:35PM -0700, David Ahern wrote:
> Easy way to build for both gcc and clang.
>
> Signed-off-by: David Ahern <dsahern@kernel.org>
> ---
> configure | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/configure b/configure
> index 8ddff43c6a7d..13f2d1739b99 100755
> --- a/configure
> +++ b/configure
> @@ -19,10 +19,10 @@ check_toolchain()
> : ${AR=ar}
> : ${CC=gcc}
> : ${YACC=bison}
> - echo "PKG_CONFIG:=${PKG_CONFIG}" >>$CONFIG
> - echo "AR:=${AR}" >>$CONFIG
> - echo "CC:=${CC}" >>$CONFIG
> - echo "YACC:=${YACC}" >>$CONFIG
> + echo "PKG_CONFIG?=${PKG_CONFIG}" >>$CONFIG
> + echo "AR?=${AR}" >>$CONFIG
> + echo "CC?=${CC}" >>$CONFIG
> + echo "YACC?=${YACC}" >>$CONFIG
> }
David, are you sure this patch is needed? Even without it I can override
from the command line:
$ make V=1 CC=gcc
lib
make[1]: Entering directory '/home/idosch/code/iproute2/lib'
gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -pipe -I../include -I../include/uapi -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -DNETNS_RUN_DIR=\"/var/run/netns\" -DNETNS_ETC_DIR=\"/etc/netns\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -fPIC -c -o libgenl.o libgenl.c
...
$ make V=1 CC=clang
lib
make[1]: Entering directory '/home/idosch/code/iproute2/lib'
clang -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -pipe -I../include -I../include/uapi -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -DNETNS_RUN_DIR=\"/var/run/netns\" -DNETNS_ETC_DIR=\"/etc/netns\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -fPIC -c -o libgenl.o libgenl.c
Also created this test file:
$ cat bla.mk
CC := foo
all:
echo $(origin CC)
echo $(CC)
$ make -f bla.mk
echo file
file
echo foo
foo
$ make -f bla.mk CC=clang
echo command line
command line
echo clang
clang
$ make -v
GNU Make 4.3
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
I'm asking because this change broke the build on our Fedora machines
and my laptop. None of them have 'yacc' installed, but they do have
'bison', which was used unconditionally before the change. After the
change, 'YACC' is set to 'yacc', as it's an implicit variable that
defaults to 'yacc':
https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH iproute2-next] configure: Allow command line override of toolchain
2022-03-02 13:56 ` Ido Schimmel
@ 2022-03-05 18:11 ` David Ahern
2022-03-05 19:32 ` Stephen Hemminger
2022-03-07 15:09 ` Ido Schimmel
0 siblings, 2 replies; 9+ messages in thread
From: David Ahern @ 2022-03-05 18:11 UTC (permalink / raw)
To: Ido Schimmel; +Cc: netdev, stephen
On 3/2/22 6:56 AM, Ido Schimmel wrote:
> David, are you sure this patch is needed? Even without it I can override
> from the command line:
>
> $ make V=1 CC=gcc
>
> lib
> make[1]: Entering directory '/home/idosch/code/iproute2/lib'
> gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -pipe -I../include -I../include/uapi -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -DNETNS_RUN_DIR=\"/var/run/netns\" -DNETNS_ETC_DIR=\"/etc/netns\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -fPIC -c -o libgenl.o libgenl.c
> ...
>
> $ make V=1 CC=clang
>
> lib
> make[1]: Entering directory '/home/idosch/code/iproute2/lib'
> clang -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -pipe -I../include -I../include/uapi -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -DNETNS_RUN_DIR=\"/var/run/netns\" -DNETNS_ETC_DIR=\"/etc/netns\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -fPIC -c -o libgenl.o libgenl.c
>
interesting. As I recall the change was needed when I was testing
Stephen's patches for a clean compile with clang. Either way, the patch
was already merged.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH iproute2-next] configure: Allow command line override of toolchain
2022-03-05 18:11 ` David Ahern
@ 2022-03-05 19:32 ` Stephen Hemminger
2022-03-07 15:09 ` Ido Schimmel
1 sibling, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2022-03-05 19:32 UTC (permalink / raw)
To: David Ahern; +Cc: Ido Schimmel, netdev
On Sat, 5 Mar 2022 11:11:43 -0700
David Ahern <dsahern@kernel.org> wrote:
> On 3/2/22 6:56 AM, Ido Schimmel wrote:
> > David, are you sure this patch is needed? Even without it I can override
> > from the command line:
> >
> > $ make V=1 CC=gcc
> >
> > lib
> > make[1]: Entering directory '/home/idosch/code/iproute2/lib'
> > gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -pipe -I../include -I../include/uapi -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -DNETNS_RUN_DIR=\"/var/run/netns\" -DNETNS_ETC_DIR=\"/etc/netns\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -fPIC -c -o libgenl.o libgenl.c
> > ...
> >
> > $ make V=1 CC=clang
> >
> > lib
> > make[1]: Entering directory '/home/idosch/code/iproute2/lib'
> > clang -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -pipe -I../include -I../include/uapi -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -DNETNS_RUN_DIR=\"/var/run/netns\" -DNETNS_ETC_DIR=\"/etc/netns\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -fPIC -c -o libgenl.o libgenl.c
> >
>
> interesting. As I recall the change was needed when I was testing
> Stephen's patches for a clean compile with clang. Either way, the patch
> was already merged.
>
Right, it maybe necessary for configure. I was using clang after already having done
configure step on my system (with gcc).
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH iproute2-next] configure: Allow command line override of toolchain
2022-03-05 18:11 ` David Ahern
2022-03-05 19:32 ` Stephen Hemminger
@ 2022-03-07 15:09 ` Ido Schimmel
2022-03-08 16:26 ` David Ahern
1 sibling, 1 reply; 9+ messages in thread
From: Ido Schimmel @ 2022-03-07 15:09 UTC (permalink / raw)
To: David Ahern; +Cc: netdev, stephen
On Sat, Mar 05, 2022 at 11:11:43AM -0700, David Ahern wrote:
> On 3/2/22 6:56 AM, Ido Schimmel wrote:
> > David, are you sure this patch is needed? Even without it I can override
> > from the command line:
> >
> > $ make V=1 CC=gcc
> >
> > lib
> > make[1]: Entering directory '/home/idosch/code/iproute2/lib'
> > gcc -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -pipe -I../include -I../include/uapi -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -DNETNS_RUN_DIR=\"/var/run/netns\" -DNETNS_ETC_DIR=\"/etc/netns\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -fPIC -c -o libgenl.o libgenl.c
> > ...
> >
> > $ make V=1 CC=clang
> >
> > lib
> > make[1]: Entering directory '/home/idosch/code/iproute2/lib'
> > clang -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -Wformat=2 -O2 -pipe -I../include -I../include/uapi -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib\" -DCONFDIR=\"/etc/iproute2\" -DNETNS_RUN_DIR=\"/var/run/netns\" -DNETNS_ETC_DIR=\"/etc/netns\" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -DHAVE_SETNS -DHAVE_HANDLE_AT -DHAVE_SELINUX -DHAVE_ELF -DHAVE_LIBMNL -DNEED_STRLCPY -DHAVE_LIBCAP -fPIC -c -o libgenl.o libgenl.c
> >
>
> interesting. As I recall the change was needed when I was testing
> Stephen's patches for a clean compile with clang. Either way, the patch
> was already merged.
I realize it was already merged (wasn't asking for academic purposes),
but rather wanted you to verify that the patch is not needed on your end
so that I could revert it. I can build with gcc/clang even without the
patch. With the patch, the build is broken on Fedora as "yacc" is not a
build dependency [1]. Verified this with a clean install of Fedora 35:
Can't build iproute with this patch after running "dnf builddep
iproute". Builds fine without it.
[1] https://src.fedoraproject.org/rpms/iproute/blob/rawhide/f/iproute.spec#_22
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH iproute2-next] configure: Allow command line override of toolchain
2022-03-07 15:09 ` Ido Schimmel
@ 2022-03-08 16:26 ` David Ahern
2022-03-08 16:41 ` Ido Schimmel
0 siblings, 1 reply; 9+ messages in thread
From: David Ahern @ 2022-03-08 16:26 UTC (permalink / raw)
To: Ido Schimmel; +Cc: netdev, stephen
On 3/7/22 8:09 AM, Ido Schimmel wrote:
>
> I realize it was already merged (wasn't asking for academic purposes),
> but rather wanted you to verify that the patch is not needed on your end
> so that I could revert it. I can build with gcc/clang even without the
> patch. With the patch, the build is broken on Fedora as "yacc" is not a
> build dependency [1]. Verified this with a clean install of Fedora 35:
> Can't build iproute with this patch after running "dnf builddep
> iproute". Builds fine without it.
>
> [1] https://src.fedoraproject.org/rpms/iproute/blob/rawhide/f/iproute.spec#_22
I booted a Fedora 35 VM and see what you mean. I can not find the
difference as to why Ubuntu 20.04 is ok and Fedora 35 is not, so I
reverted the patch.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH iproute2-next] configure: Allow command line override of toolchain
2022-03-08 16:26 ` David Ahern
@ 2022-03-08 16:41 ` Ido Schimmel
0 siblings, 0 replies; 9+ messages in thread
From: Ido Schimmel @ 2022-03-08 16:41 UTC (permalink / raw)
To: David Ahern; +Cc: netdev, stephen
On Tue, Mar 08, 2022 at 09:26:49AM -0700, David Ahern wrote:
> On 3/7/22 8:09 AM, Ido Schimmel wrote:
> >
> > I realize it was already merged (wasn't asking for academic purposes),
> > but rather wanted you to verify that the patch is not needed on your end
> > so that I could revert it. I can build with gcc/clang even without the
> > patch. With the patch, the build is broken on Fedora as "yacc" is not a
> > build dependency [1]. Verified this with a clean install of Fedora 35:
> > Can't build iproute with this patch after running "dnf builddep
> > iproute". Builds fine without it.
> >
> > [1] https://src.fedoraproject.org/rpms/iproute/blob/rawhide/f/iproute.spec#_22
>
> I booted a Fedora 35 VM and see what you mean. I can not find the
> difference as to why Ubuntu 20.04 is ok and Fedora 35 is not, so I
> reverted the patch.
I tested with Ubuntu 21.10 yesterday and it worked for me as well.
There 'yacc' eventually points to '/usr/bin/bison.yacc'.
Anyway, thanks for taking care of that
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-03-08 16:42 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-28 1:54 [PATCH iproute2-next] configure: Allow command line override of toolchain David Ahern
2022-02-28 17:11 ` Stephen Hemminger
2022-02-28 17:50 ` patchwork-bot+netdevbpf
2022-03-02 13:56 ` Ido Schimmel
2022-03-05 18:11 ` David Ahern
2022-03-05 19:32 ` Stephen Hemminger
2022-03-07 15:09 ` Ido Schimmel
2022-03-08 16:26 ` David Ahern
2022-03-08 16:41 ` Ido Schimmel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).