[RTEMS Project] #4631: RSB fails to build gdb on Fedora 35
RTEMS trac
trac at rtems.org
Fri Mar 18 12:09:33 UTC 2022
#4631: RSB fails to build gdb on Fedora 35
-----------------------------+--------------------
Reporter: Frank Kuehndel | Owner: (none)
Type: defect | Status: new
Priority: normal | Milestone: 6.1
Component: tool/gdb | Version: 6
Severity: normal | Keywords:
Blocked By: | Blocking:
-----------------------------+--------------------
The rtems-source-builder fails to build the tools in a Fedora 35
container. I am building ARM for RTEMS 6 and get this error message:
{{{
config: tools/rtems-gdb-11.2.cfg
error: shell macro failed: /home/minna/src/rtems-source-builder/source-
builder/sb/rtems-build-dep -c gcc -l : 2: error: no library (-l) provided
Build Set: Time 0:00:33.396165
}}}
The same error appears for other architectures like AARCH64, POWERPC,
RISCV on Fedora 35. The source for this error is in file `source-
builder/config/gdb-common-1.cfg` in line 118:
{{{
104 %ifnos darwin
105 %if %{host_ldflags} == %{nil}
106 %define gdb-host-libs %{nil}
107 %else
108 %define gdb-host-libs -L '%{host_ldflags}'
109 %endif
110 %if %{gdb-python-config} != %{nil}
111 %define gdb-python-lib-filter awk 'BEGIN{FS="
"}/python/{for(i=1;i<NF;++i)if(match($i,".*lpython.*")) print
"lib"substr($i,3)"*";}'
112 %if %{gdb-python-ver-mm} < 3.8
113 %define gdb-python-config-lib-check-flags --ldflags
114 %else
115 %define gdb-python-config-lib-check-flags --ldflags
--embed
116 %endif
117 %define gdb-python-config-libs %(%{gdb-python-config} %{gdb-
python-config-lib-check-flags} | %{gdb-python-lib-filter})
118 %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c
%{__cc} %{gdb-host-libs} -l %{gdb-python-config-libs})
119 %else
120 %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c
%{__cc} %{gdb-host-libs} -l %{gdb-python-ver-lib})
121 %endif
122 %if %{gdb-python-lib-check} == not-found &&
!%{_rsb_getting_source}
123 %error "gdb: python: library file not found: %{gdb-python-ver-
lib}, please install"
124 %endif
125 %endif
}}}
Some values of involved variables:
{{{
gdb-python-ver-mm = 3.10
gdb-python-config = /usr/bin/python3-config
gdb-python-config-lib-check-flags = --ldflags
gdb-python-lib-filter = awk 'BEGIN{FS="
"}/python/{for(i=1;i<NF;++i)if(match($i,".*lpython.*")) print
"lib"substr($i,3)"*";}'
gdb-python-config-libs = ''
}}}
The trouble is that `gdb-python-config-libs` is empty when line 118 gets
called. It is empty because there is no `python`-library in the output of
this call on Fedora 35:
{{{
$ /usr/bin/python3-config --ldflags
-L/usr/lib64 -lcrypt -ldl -lm -lm
}}}
Just to compare, on OpenSUSE 15.3 the same call returns (note the
`-lpython3.6m `):
{{{
$ /usr/bin/python3-config --ldflags
-L/usr/lib64 -lpython3.6m -lpthread -ldl -lutil -lm -Xlinker -export-
dynamic
}}}
Commenting out line 118 makes the build go through smoothly but I would
prefer a permanent fix.
* Would be skipping line 118 when `gdb-python-config-libs` is empty be an
appropriate solution?
* Is the "real" error in line 112? (`%if 3.10 < 3.8` evaluates
unexpectedly to `true`)
* Would the "error" in line 123 print out the correct library name?
* Does the whole check make sense when `python3-config` is obviously
installed (both the command and the library are "usually" in the same
`pythonX-devel` package)?
Notes:
* On Fedora 35 `/usr/lib64/libpython3.10.so` exists.
* On Fedora 35 adding `--embed` provides the library:
{{{
$ /usr/bin/python3-config --ldflags --embed
-L/usr/lib64 -lpython3.10 -lcrypt -ldl -lm -lm
}}}
For the records:
Command:
{{{
../source-builder/sb-set-builder --rtems-version 6 --prefix /opt/rtems/6
--with_cxx --with_fortran --with_objc --jobs=12 --log ~/sb-set-builder.log
6/rtems-arm
}}}
RTEMS rtems-source-builder git: `6fe98f91d94bbf965bc0e78015585ff8823d17bd`
RTEMS: 6
Target architecture: ARM
Host architecture: x86_64
Hoast Kernel: `5.3.18-150300.59.49-default`
OS: Fedora Linux 35 (Container Image)
Container image base: `docker.io/library/fedora:latest`
Python version in container: 3.10.2
Test date: 2022-03-18T11:02:10+01:00
`rtems-source-builder/source-builder/sb-check` log:
{{{
RTEMS Source Builder - Check, 6 (6fe98f91d94b modified)
warning: exe: absolute exe found in path: (__chown) /usr/sbin/chown
warning: exe: absolute exe found in path: (__install_info) /usr/bin
/install-info
Environment is ok
}}}
--
Ticket URL: <http://devel.rtems.org/ticket/4631>
RTEMS Project <http://www.rtems.org/>
RTEMS Project
More information about the bugs
mailing list