elfutils-0.187 failing to build for a MUSL MIPS target

2022-06-29 Thread Immolo via Elfutils-devel
Hi,

When trying to cross compile elfutils-0.187 for a MIPS device it fails with
various errors depending on the USE flags set on my crossdev Gentoo setup.

I believe but have not confirmed this is a MIPS issue until I have done
further tests.

in the MUSL overlay also fails with the same issue so I need to run some
 further tests on other arches.


With USE="bzip2 nls threads utils" I get a numbe of undefined variables
with the final error "being undefined reference to `assert_perror'"

With USE="-*" then it becomes:

 213 |   if (fnmatch (pattern->pattern, name, FNM_EXTMATCH) == 0)
  |^~~~
  |FNM_NOMATCH
/usr/mipsr5900el-unknown-linux-musl/tmp/portage/dev-libs/elfutils-0.187/work/elfutils-0.187/src/strip.c:213:44:
note: each undeclared identifier is reported only once for each
function it appears in
/usr/mipsr5900el-unknown-linux-musl/tmp/portage/dev-libs/elfutils-0.187/work/elfutils-0.187/src/strip.c:
In function ‘parse_opt’:
/usr/mipsr5900el-unknown-linux-musl/tmp/portage/dev-libs/elfutils-0.187/work/elfutils-0.187/src/strip.c:329:37:
error: ‘FNM_EXTMATCH’ undeclared (first use in this function); did you
mean ‘FNM_NOMATCH’?
  329 |   if (fnmatch (arg, ".comment", FNM_EXTMATCH) == 0)
  | ^~~~
  | FNM_NOMATCH

fI'll include the build logs for both below but I would be grateful if
anyone has any ideas on how I can start to solve this isse.

https://www.immolo.co.uk/elfutils/nouse-build.log

https://www.immolo.co.uk/elfutils/withuse-build.log


[PATCH] config: Remove unnecessary setting/unsetting of prefix in profiles

2022-06-29 Thread Mark Wielaard
In both profile.csh.in and profile.sh.in we set and then unset
prefix, but never use it.

Signed-off-by: Mark Wielaard 
---
 config/ChangeLog  | 5 +
 config/profile.csh.in | 2 --
 config/profile.sh.in  | 2 --
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/config/ChangeLog b/config/ChangeLog
index cfb37b42..603fbcb0 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,8 @@
+2022-06-29  Mark Wielaard  
+
+   * profile.csh.in: Remove setting/unsetting of prefix.
+   * profile.sh.in: Likewise.
+
 2022-05-03  Mark Wielaard  
 
* profile.csh.in: Move the 2>/dev/null inside the sh -c '' quotes.
diff --git a/config/profile.csh.in b/config/profile.csh.in
index 74c20c99..b61b467b 100644
--- a/config/profile.csh.in
+++ b/config/profile.csh.in
@@ -5,12 +5,10 @@
 # such as $DEBUGINFOD_MAXSIZE, $DEBUGINFOD_MAXTIME, $DEBUGINFOD_PROGRESS.
 
 if (! $?DEBUGINFOD_URLS) then
-set prefix="@prefix@"
 set DEBUGINFOD_URLS=`sh -c 'cat "$0"/*.urls 2>/dev/null; :' 
"@sysconfdir@/debuginfod" | tr '\n' ' '`
 if ( "$DEBUGINFOD_URLS" != "" ) then
 setenv DEBUGINFOD_URLS "$DEBUGINFOD_URLS"
 else
 unset DEBUGINFOD_URLS
 endif
-unset prefix
 endif
diff --git a/config/profile.sh.in b/config/profile.sh.in
index bad20b1e..9a978a6b 100644
--- a/config/profile.sh.in
+++ b/config/profile.sh.in
@@ -5,8 +5,6 @@
 # such as $DEBUGINFOD_MAXSIZE, $DEBUGINFOD_MAXTIME, $DEBUGINFOD_PROGRESS.
 
 if [ -z "$DEBUGINFOD_URLS" ]; then
-prefix="@prefix@"
 DEBUGINFOD_URLS=$(cat "@sysconfdir@/debuginfod"/*.urls 2>/dev/null | tr 
'\n' ' ')
 [ -n "$DEBUGINFOD_URLS" ] && export DEBUGINFOD_URLS || unset 
DEBUGINFOD_URLS
-unset prefix
 fi
-- 
2.18.4



Re: [PATCH] config: Remove unnecessary setting/unsetting of prefix in profiles

2022-06-29 Thread Frank Ch. Eigler via Elfutils-devel
Hi -

> In both profile.csh.in and profile.sh.in we set and then unset
> prefix, but never use it.

It is used, because the autoconf @sysconfdir@ macro expands to a
string like "$prefix/...", which requires the shell variable $prefix
to be set.

- FChE



Re: [PATCH] config: Remove unnecessary setting/unsetting of prefix in profiles

2022-06-29 Thread Mark Wielaard
Hi Frank,

On Wed, Jun 29, 2022 at 01:29:04PM -0400, Frank Ch. Eigler wrote:
> > In both profile.csh.in and profile.sh.in we set and then unset
> > prefix, but never use it.
> 
> It is used, because the autoconf @sysconfdir@ macro expands to a
> string like "$prefix/...", which requires the shell variable $prefix
> to be set.

O, I see. Indeed the default is '${prefix}/etc'. But I never saw that
because in a package install configure is called with everything
expanded [*]. Should have tried by hand.

Patch retracted.

Thanks,

Mark

[*] --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin
--sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share
--includedir=/usr/include --libdir=/usr/lib64
--libexecdir=/usr/libexec --localstatedir=/var
--sharedstatedir=/var/lib --mandir=/usr/share/man
--infodir=/usr/share/info



Re: [PATCH] config: Remove unnecessary setting/unsetting of prefix in profiles

2022-06-29 Thread Dmitry V. Levin
Hi,

On Wed, Jun 29, 2022 at 08:33:19PM +0200, Mark Wielaard wrote:
> Hi Frank,
> 
> On Wed, Jun 29, 2022 at 01:29:04PM -0400, Frank Ch. Eigler wrote:
> > > In both profile.csh.in and profile.sh.in we set and then unset
> > > prefix, but never use it.
> > 
> > It is used, because the autoconf @sysconfdir@ macro expands to a
> > string like "$prefix/...", which requires the shell variable $prefix
> > to be set.
> 
> O, I see. Indeed the default is '${prefix}/etc'. But I never saw that
> because in a package install configure is called with everything
> expanded [*]. Should have tried by hand.

This is not the first time when a patch removing these definitions of
"prefix" variable is proposed.  In fact, I applied a similar patch in my
tree last year because I always use --sysconfdir=/etc and "prefix" is a
very generic name so I prefer not to tamper with it in profile scripts.


-- 
ldv