* [ptxdist] Check for specific libc version
@ 2015-08-18 10:30 Ladislav Michl
2015-09-28 10:29 ` Michael Olbrich
0 siblings, 1 reply; 4+ messages in thread
From: Ladislav Michl @ 2015-08-18 10:30 UTC (permalink / raw)
To: ptxdist
Hi there!
PTXCONF_GLIBC_VERSION is used for check for specific toolchain. However when left
blank, compilation fails with:
---------------------------
target: glibc.targetinstall
---------------------------
ptxdist: error: ptxd_make_xpkg_init: please define <PKG>_VERSION
ptxdist/rules/glibc.make:30: recipe for target 'glibc.targetinstall' failed
shouldn't we get libc version from toolchain in this case?
This problem has side effect: as it seems the only variable used from
Versions.make is PTXDIST_FULLVERSION composed from PTXDIST_VERSION_FULL and
PTXCONF_PROJECT_VERSION where PTXCONF_PROJECT_VERSION is dumped anyway,
what about:
---
rules/post/dump.make | 2 +-
rules/pre/Version.make | 27 ---------------------------
2 files changed, 1 insertion(+), 28 deletions(-)
delete mode 100644 rules/pre/Version.make
diff --git a/rules/post/dump.make b/rules/post/dump.make
index 9931ee4..bba46d7 100644
--- a/rules/post/dump.make
+++ b/rules/post/dump.make
@@ -26,7 +26,7 @@ M2B_DUMP_VARIABLES := \
PTXCONF_CONFIGFILE_VERSION \
PTXCONFIG PTXCONF_SYSROOT_TARGET PTXCONF_PROJECT PTXCONF_PROJECT_VERSION \
PTXDIST_WORKSPACE PTXDIST_TOPDIR \
- PTXDIST PTXDIST_FULLVERSION \
+ PTXDIST PTXDIST_VERSION_FULL \
RULESDIR SCRIPTSDIR STATEDIR SYSROOT WORKDIR \
PACKAGES- PACKAGES-y PACKAGES-m
diff --git a/rules/pre/Version.make b/rules/pre/Version.make
deleted file mode 100644
index 5ebc827..0000000
--- a/rules/pre/Version.make
+++ /dev/null
@@ -1,27 +0,0 @@
-# -*-makefile-*-
-#
-# Copyright (C) 2003 by Marc Kleine-Budde <kleine-budde@gmx.de>
-# (C) 2008 by Wolfram Sang <w.sang@pengutronix.de>
-#
-# See CREDITS for details about who has contributed to this project.
-#
-# For further information about the PTXdist project and license conditions
-# see the README file.
-#
-
-GCC_VERSION := $(call remove_quotes,$(PTXCONF_CROSSCHAIN_CHECK))
-_version_temp := $(subst ., ,$(GCC_VERSION))
-GCC_VERSION_MAJOR := $(word 1,$(_version_temp))
-GCC_VERSION_MINOR := $(word 2,$(_version_temp))
-GCC_VERSION_MICRO := $(word 3,$(_version_temp))
-
-GLIBC_VERSION := $(call remove_quotes,$(PTXCONF_GLIBC_VERSION))
-_version_temp := $(subst ., ,$(GLIBC_VERSION))
-GLIBC_VERSION_MAJOR := $(word 1,$(_version_temp))
-GLIBC_VERSION_MINOR := $(word 2,$(_version_temp))
-GLIBC_VERSION_MICRO := $(word 3,$(_version_temp))
-
-PTXDIST_FULLVERSION := $(call remove_quotes,ptxdist-$(PTXDIST_VERSION_FULL)$(PTXCONF_PROJECT_VERSION))
-_version_temp :=
-
-# vim: syntax=make
--
2.1.4
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ptxdist] Check for specific libc version
2015-08-18 10:30 [ptxdist] Check for specific libc version Ladislav Michl
@ 2015-09-28 10:29 ` Michael Olbrich
2015-09-30 9:30 ` Ladislav Michl
2016-01-21 10:52 ` Ladislav Michl
0 siblings, 2 replies; 4+ messages in thread
From: Michael Olbrich @ 2015-09-28 10:29 UTC (permalink / raw)
To: ptxdist
On Tue, Aug 18, 2015 at 12:30:41PM +0200, Ladislav Michl wrote:
> Hi there!
>
>
> PTXCONF_GLIBC_VERSION is used for check for specific toolchain. However when left
> blank, compilation fails with:
> ---------------------------
> target: glibc.targetinstall
> ---------------------------
>
> ptxdist: error: ptxd_make_xpkg_init: please define <PKG>_VERSION
> ptxdist/rules/glibc.make:30: recipe for target 'glibc.targetinstall' failed
>
> shouldn't we get libc version from toolchain in this case?
No. Reproducibility is one of the main goals of PTXdist. What we should
actually do is check if PTXCONF_GLIBC_VERSION matches the actual glibc
version, like we do for gcc. However, I'm not sure, if there is a simple
test for that. I see a libc-<version>.so in my toolchains, but I\m not sure
if that's always the case.
> This problem has side effect: as it seems the only variable used from
> Versions.make is PTXDIST_FULLVERSION composed from PTXDIST_VERSION_FULL and
> PTXCONF_PROJECT_VERSION where PTXCONF_PROJECT_VERSION is dumped anyway,
> what about:
Be careful with making such statements. We have many cases where variables
names are generated like this:
base :=GCC
version_var :=$(base)_VERSION
major :=$($(version_var)_MAJOR)
This example is completely fabricated, but I think you can see how just
searching for the variable names is not enough.
In this case, I think the variables aren't used, but I'll need to review
the code carefully before applying such a patch.
Michael
> ---
> rules/post/dump.make | 2 +-
> rules/pre/Version.make | 27 ---------------------------
> 2 files changed, 1 insertion(+), 28 deletions(-)
> delete mode 100644 rules/pre/Version.make
>
> diff --git a/rules/post/dump.make b/rules/post/dump.make
> index 9931ee4..bba46d7 100644
> --- a/rules/post/dump.make
> +++ b/rules/post/dump.make
> @@ -26,7 +26,7 @@ M2B_DUMP_VARIABLES := \
> PTXCONF_CONFIGFILE_VERSION \
> PTXCONFIG PTXCONF_SYSROOT_TARGET PTXCONF_PROJECT PTXCONF_PROJECT_VERSION \
> PTXDIST_WORKSPACE PTXDIST_TOPDIR \
> - PTXDIST PTXDIST_FULLVERSION \
> + PTXDIST PTXDIST_VERSION_FULL \
> RULESDIR SCRIPTSDIR STATEDIR SYSROOT WORKDIR \
> PACKAGES- PACKAGES-y PACKAGES-m
>
> diff --git a/rules/pre/Version.make b/rules/pre/Version.make
> deleted file mode 100644
> index 5ebc827..0000000
> --- a/rules/pre/Version.make
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -# -*-makefile-*-
> -#
> -# Copyright (C) 2003 by Marc Kleine-Budde <kleine-budde@gmx.de>
> -# (C) 2008 by Wolfram Sang <w.sang@pengutronix.de>
> -#
> -# See CREDITS for details about who has contributed to this project.
> -#
> -# For further information about the PTXdist project and license conditions
> -# see the README file.
> -#
> -
> -GCC_VERSION := $(call remove_quotes,$(PTXCONF_CROSSCHAIN_CHECK))
> -_version_temp := $(subst ., ,$(GCC_VERSION))
> -GCC_VERSION_MAJOR := $(word 1,$(_version_temp))
> -GCC_VERSION_MINOR := $(word 2,$(_version_temp))
> -GCC_VERSION_MICRO := $(word 3,$(_version_temp))
> -
> -GLIBC_VERSION := $(call remove_quotes,$(PTXCONF_GLIBC_VERSION))
> -_version_temp := $(subst ., ,$(GLIBC_VERSION))
> -GLIBC_VERSION_MAJOR := $(word 1,$(_version_temp))
> -GLIBC_VERSION_MINOR := $(word 2,$(_version_temp))
> -GLIBC_VERSION_MICRO := $(word 3,$(_version_temp))
> -
> -PTXDIST_FULLVERSION := $(call remove_quotes,ptxdist-$(PTXDIST_VERSION_FULL)$(PTXCONF_PROJECT_VERSION))
> -_version_temp :=
> -
> -# vim: syntax=make
> --
> 2.1.4
>
>
> --
> ptxdist mailing list
> ptxdist@pengutronix.de
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ptxdist] Check for specific libc version
2015-09-28 10:29 ` Michael Olbrich
@ 2015-09-30 9:30 ` Ladislav Michl
2016-01-21 10:52 ` Ladislav Michl
1 sibling, 0 replies; 4+ messages in thread
From: Ladislav Michl @ 2015-09-30 9:30 UTC (permalink / raw)
To: ptxdist
On Mon, Sep 28, 2015 at 12:29:02PM +0200, Michael Olbrich wrote:
> On Tue, Aug 18, 2015 at 12:30:41PM +0200, Ladislav Michl wrote:
> > Hi there!
> >
> >
> > PTXCONF_GLIBC_VERSION is used for check for specific toolchain. However when left
> > blank, compilation fails with:
> > ---------------------------
> > target: glibc.targetinstall
> > ---------------------------
> >
> > ptxdist: error: ptxd_make_xpkg_init: please define <PKG>_VERSION
> > ptxdist/rules/glibc.make:30: recipe for target 'glibc.targetinstall' failed
> >
> > shouldn't we get libc version from toolchain in this case?
>
> No. Reproducibility is one of the main goals of PTXdist. What we should
> actually do is check if PTXCONF_GLIBC_VERSION matches the actual glibc
> version, like we do for gcc.
Agree, but we are already selecting toolchains, which gives a clue about
glibc used. For gcclibs code reads:
ifeq ($(shell which $(CROSS_CC) 2>/dev/null),)
GCCLIBS_VERSION := unknown
else
GCCLIBS_VERSION := $(shell $(CROSS_CC) -dumpversion)
endif
and GCC version is verified earlier in check_compiler(). But leaving
GLIBC_VERSION blank does not make PTXdist complain. Everything is built
and it is targetinstall which fails. That a bit unexpected to me. I would
expect
a) glibc version picked from toolchain or
b) ptxdist bailing out early
when glibc version is not specified. But you already voted for b).
Also using the real glibc version in package name instead of some
random string makes more sense.
> However, I'm not sure, if there is a simple test for that. I see a
> libc-<version>.so in my toolchains, but I\m not sure if that's always
> the case.
usr/bin/ldd from sysroot holds answer as well, also
strings <glibc.so> | grep "version [0-9]" could work.
ladis
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ptxdist] Check for specific libc version
2015-09-28 10:29 ` Michael Olbrich
2015-09-30 9:30 ` Ladislav Michl
@ 2016-01-21 10:52 ` Ladislav Michl
1 sibling, 0 replies; 4+ messages in thread
From: Ladislav Michl @ 2016-01-21 10:52 UTC (permalink / raw)
To: ptxdist; +Cc: Michael Olbrich
On Mon, Sep 28, 2015 at 12:29:02PM +0200, Michael Olbrich wrote:
> On Tue, Aug 18, 2015 at 12:30:41PM +0200, Ladislav Michl wrote:
[...]
> > This problem has side effect: as it seems the only variable used from
> > Versions.make is PTXDIST_FULLVERSION composed from PTXDIST_VERSION_FULL and
> > PTXCONF_PROJECT_VERSION where PTXCONF_PROJECT_VERSION is dumped anyway,
> > what about:
>
> Be careful with making such statements. We have many cases where variables
> names are generated like this:
>
> base :=GCC
> version_var :=$(base)_VERSION
> major :=$($(version_var)_MAJOR)
>
> This example is completely fabricated, but I think you can see how just
> searching for the variable names is not enough.
>
> In this case, I think the variables aren't used, but I'll need to review
> the code carefully before applying such a patch.
Gentle ping... I'm still holding this patch in my tree and built quite few
projects with it. So, here it is again for your consideration
From: Ladislav Michl <ladis@linux-mips.org>
Date: Tue, 18 Aug 2015 12:18:13 +0200
Subject: [PATCH] Remove unused Version.make
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
rules/post/dump.make | 2 +-
rules/pre/Version.make | 27 ---------------------------
2 files changed, 1 insertion(+), 28 deletions(-)
delete mode 100644 rules/pre/Version.make
diff --git a/rules/post/dump.make b/rules/post/dump.make
index 9931ee4..bba46d7 100644
--- a/rules/post/dump.make
+++ b/rules/post/dump.make
@@ -26,7 +26,7 @@ M2B_DUMP_VARIABLES := \
PTXCONF_CONFIGFILE_VERSION \
PTXCONFIG PTXCONF_SYSROOT_TARGET PTXCONF_PROJECT PTXCONF_PROJECT_VERSION \
PTXDIST_WORKSPACE PTXDIST_TOPDIR \
- PTXDIST PTXDIST_FULLVERSION \
+ PTXDIST PTXDIST_VERSION_FULL \
RULESDIR SCRIPTSDIR STATEDIR SYSROOT WORKDIR \
PACKAGES- PACKAGES-y PACKAGES-m
diff --git a/rules/pre/Version.make b/rules/pre/Version.make
deleted file mode 100644
index 5ebc827..0000000
--- a/rules/pre/Version.make
+++ /dev/null
@@ -1,27 +0,0 @@
-# -*-makefile-*-
-#
-# Copyright (C) 2003 by Marc Kleine-Budde <kleine-budde@gmx.de>
-# (C) 2008 by Wolfram Sang <w.sang@pengutronix.de>
-#
-# See CREDITS for details about who has contributed to this project.
-#
-# For further information about the PTXdist project and license conditions
-# see the README file.
-#
-
-GCC_VERSION := $(call remove_quotes,$(PTXCONF_CROSSCHAIN_CHECK))
-_version_temp := $(subst ., ,$(GCC_VERSION))
-GCC_VERSION_MAJOR := $(word 1,$(_version_temp))
-GCC_VERSION_MINOR := $(word 2,$(_version_temp))
-GCC_VERSION_MICRO := $(word 3,$(_version_temp))
-
-GLIBC_VERSION := $(call remove_quotes,$(PTXCONF_GLIBC_VERSION))
-_version_temp := $(subst ., ,$(GLIBC_VERSION))
-GLIBC_VERSION_MAJOR := $(word 1,$(_version_temp))
-GLIBC_VERSION_MINOR := $(word 2,$(_version_temp))
-GLIBC_VERSION_MICRO := $(word 3,$(_version_temp))
-
-PTXDIST_FULLVERSION := $(call remove_quotes,ptxdist-$(PTXDIST_VERSION_FULL)$(PTXCONF_PROJECT_VERSION))
-_version_temp :=
-
-# vim: syntax=make
--
2.1.4
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-21 10:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-18 10:30 [ptxdist] Check for specific libc version Ladislav Michl
2015-09-28 10:29 ` Michael Olbrich
2015-09-30 9:30 ` Ladislav Michl
2016-01-21 10:52 ` Ladislav Michl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox