Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tool chain update for 23.05 release #4827

Closed
cproc opened this issue May 2, 2023 · 60 comments
Closed

tool chain update for 23.05 release #4827

cproc opened this issue May 2, 2023 · 60 comments
Assignees
Labels

Comments

@cproc
Copy link
Member

cproc commented May 2, 2023

No description provided.

@cproc cproc self-assigned this May 2, 2023
cproc added a commit to cproc/genode that referenced this issue May 2, 2023
cproc added a commit to cproc/genode that referenced this issue May 2, 2023
cproc added a commit to cproc/genode that referenced this issue May 2, 2023
cproc added a commit to cproc/genode that referenced this issue May 2, 2023
cproc added a commit to cproc/genode that referenced this issue May 2, 2023
cproc added a commit to cproc/genode that referenced this issue May 2, 2023
cproc added a commit to cproc/genode that referenced this issue May 2, 2023
@cproc
Copy link
Member Author

cproc commented May 2, 2023

My issue4827 branch [1] contains a first version of the update with binutils 2.40 and gcc 12.2.0.

TODO:

  • RISC-V support
  • ADA runtime update
  • GDB update
  • use C++20 by default

I'm going to create separate issues for the new errors which occurred so far when I tried to build Genode with the updated tools.

[1] https://github.com/cproc/genode/tree/issue4827

@nfeske
Copy link
Member

nfeske commented May 2, 2023

That's just fantastic! @cproc, you made my day.

@chelmuth
Copy link
Member

chelmuth commented May 2, 2023

I just merged all compilation fixes to staging in preparation.

cproc added a commit to cproc/genode that referenced this issue May 3, 2023
cproc added a commit to cproc/genode that referenced this issue May 3, 2023
cproc added a commit to cproc/genode that referenced this issue May 3, 2023
cproc added a commit to cproc/genode that referenced this issue May 3, 2023
cproc added a commit to cproc/genode that referenced this issue May 3, 2023
cproc added a commit to cproc/genode that referenced this issue May 3, 2023
cproc added a commit to cproc/genode that referenced this issue May 3, 2023
@chelmuth
Copy link
Member

chelmuth commented May 4, 2023

I tried to build the tool chain via ./tool/tool_chain x86 MAKE_JOBS=28 BUILD_LOCATION=/var/tmp/build-23.05 but got the following errors.

gpr-env.adb:1867:16: no candidate interpretations match the actuals:
gpr-env.adb:1867:16: missing argument for parameter "Separators" in call to "CREATE" declared at g-arrspl.ads:97, instance at g-strspl.ads:39
gpr-env.adb:1867:16: missing argument for parameter "Separators" in call to "CREATE" declared at g-arrspl.ads:83, instance at g-strspl.ads:39
gpr-env.adb:1867:16: context requires function call, found procedure name
gpr-env.adb:1867:53: unmatched actual "Mode" in call
gpr-env.adb:1868:16: ambiguous call to "Append"
gpr-env.adb:1868:16: possible interpretation at a-coinve.ads:230, instance at gpr-util.ads:39
gpr-env.adb:1868:16: possible interpretation at a-coinve.ads:234, instance at gpr-util.ads:39
gpr-env.adb:1868:25: "P" is undefined
gpr-env.adb:1884:19: no selector "Prepend_Vector" for private type "Ada.Containers.Indefinite_Vectors.Vector" from instance at gpr-util.ads:39
gpr-env.adb:1886:19: no selector "Append_Vector" for private type "Ada.Containers.Indefinite_Vectors.Vector" from instance at gpr-util.ads:39
gprbuild-link.adb:762:20: no selector "Append_Vector" for private type "Ada.Containers.Indefinite_Vectors.Vector" from instance at gpr-util.ads:39
gprbuild-link.adb:793:22: no selector "Append_Vector" for private type "Ada.Containers.Indefinite_Vectors.Vector" from instance at gprbuild.ads:165
gprbuild-link.adb:796:22: no selector "Append_Vector" for private type "Ada.Containers.Indefinite_Vectors.Vector" from instance at gprbuild.ads:165
gprbuild-link.adb:879:19: no selector "Append_Vector" for private type "Ada.Containers.Indefinite_Vectors.Vector" from instance at gprbuild.ads:165
gprbuild-link.adb:3364:37: no selector "Append_Vector" for private type "Ada.Containers.Indefinite_Vectors.Vector" from instance at gprbuild.ads:165
gprbuild-link.adb:3383:19: no selector "Append_Vector" for private type "Ada.Containers.Indefinite_Vectors.Vector" from instance at gprbuild.ads:165
gpr-env.adb:1867:16: no candidate interpretations match the actuals:
gpr-env.adb:1867:16: missing argument for parameter "Separators" in call to "CREATE" declared at g-arrspl.ads:97, instance at g-strspl.ads:39
gpr-env.adb:1867:16: missing argument for parameter "Separators" in call to "CREATE" declared at g-arrspl.ads:83, instance at g-strspl.ads:39
gpr-env.adb:1867:16: context requires function call, found procedure name
gpr-env.adb:1867:53: unmatched actual "Mode" in call
gpr-env.adb:1868:16: ambiguous call to "Append"
gpr-env.adb:1868:16: possible interpretation at a-coinve.ads:230, instance at gpr-util.ads:39
gpr-env.adb:1868:16: possible interpretation at a-coinve.ads:234, instance at gpr-util.ads:39
gpr-env.adb:1868:25: "P" is undefined
gpr-env.adb:1884:19: no selector "Prepend_Vector" for private type "Ada.Containers.Indefinite_Vectors.Vector" from instance at gpr-util.ads:39
gpr-env.adb:1886:19: no selector "Append_Vector" for private type "Ada.Containers.Indefinite_Vectors.Vector" from instance at gpr-util.ads:39
gnatmake: "/var/tmp/build-23.05/bootstrap/gprbuild/gpr/src/gpr-env.adb" compilation error
gnatmake: "/var/tmp/build-23.05/bootstrap/gprbuild/src/gprbuild-link.adb" compilation error
gnatmake: "/var/tmp/build-23.05/bootstrap/gprbuild/gpr/src/gpr-util.adb" compilation error
make: *** [tool/tool_chain:472: /var/tmp/build-23.05/bootstrap/install/bin/gprbuild] Error 4

Info about the Linux installation

  • Ubuntu 20.04.5 LTS
  • gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
  • GNATMAKE 9.4.0

@cproc
Copy link
Member Author

cproc commented May 4, 2023

@chelmuth: can you execute binaries from /var/tmp? I wonder if maybe the host tools are used to build gprbuild instead of the bootstrap tools.

@chelmuth
Copy link
Member

chelmuth commented May 4, 2023

The following succeeds, or did I get you wrong?

> /var/tmp/build-23.05/bootstrap/gcc/gcc/nm --version
GNU nm (GNU Binutils) 2.40
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.

@chelmuth
Copy link
Member

chelmuth commented May 4, 2023

Is the following correct or does it confirm your suspicion? Do you need more info?

> head /var/tmp/build-23.05/bootstrap/gprbuild/gprbuild.ali 
V "GNAT Lib v9"
P ZX

@cproc
Copy link
Member Author

cproc commented May 4, 2023

Is the following correct or does it confirm your suspicion? Do you need more info?

> head /var/tmp/build-23.05/bootstrap/gprbuild/gprbuild.ali 
V "GNAT Lib v9"
P ZX

In my Xubuntu 20.04 test VM it says

V "GNAT Lib v12"
P SS ZX

The tool_chain script prepends the bootstrap install location to the PATH environment variable, so normally the bootstrap tools should be used to build gprbuild. Since the execution permission of the bootstrap binaries is not the problem, maybe a bootstrap tool is missing for some reason? This is the output I get from ls -1 /var/tmp/build-23.05/bootstrap/install/bin:

addr2line
ar
as
c++
c++filt
cpp
elfedit
g++
gcc
gcc-ar
gccgo
gcc-nm
gcc-ranlib
gcov
gcov-dump
gcov-tool
gnat
gnatbind
gnatchop
gnatclean
gnatkr
gnatlink
gnatls
gnatmake
gnatname
gnatprep
gprbuild
gprclean
gprconfig
gprinstall
gprls
gprname
ld
ld.bfd
nm
objcopy
objdump
ranlib
readelf
size
strings
strip
x86_64-pc-linux-gnu-c++
x86_64-pc-linux-gnu-g++
x86_64-pc-linux-gnu-gcc
x86_64-pc-linux-gnu-gcc-12.2.0
x86_64-pc-linux-gnu-gcc-ar
x86_64-pc-linux-gnu-gccgo
x86_64-pc-linux-gnu-gcc-nm
x86_64-pc-linux-gnu-gcc-ranlib

@chelmuth
Copy link
Member

chelmuth commented May 4, 2023

> ls -1 /var/tmp/build-23.05/bootstrap/install/bin
addr2line*
ar*
as*
c++*
c++filt*
cpp*
elfedit*
g++*
gcc*
gcc-ar*
gcc-nm*
gcc-ranlib*
gcov*
gcov-dump*
gcov-tool*
ld*
ld.bfd*
nm*
objcopy*
objdump*
ranlib*
readelf*
size*
strings*
strip*
x86_64-pc-linux-gnu-c++*
x86_64-pc-linux-gnu-g++*
x86_64-pc-linux-gnu-gcc*
x86_64-pc-linux-gnu-gcc-12.2.0*
x86_64-pc-linux-gnu-gcc-ar*
x86_64-pc-linux-gnu-gcc-nm*
x86_64-pc-linux-gnu-gcc-ranlib*

@chelmuth
Copy link
Member

chelmuth commented May 4, 2023

Could it be I have an incomplete/inconsistent state as I started with ENABLE_FEATURES="c c++" and later extended to ENABLE_FEATURES="c c++ ada"?

@cproc
Copy link
Member Author

cproc commented May 4, 2023

Could it be I have an incomplete/inconsistent state as I started with ENABLE_FEATURES="c c++" and later extended to ENABLE_FEATURES="c c++ ada"?

That could be the reason. There is currently only a make dependency on the existence of g++ in the bootstrap install location.

@chelmuth
Copy link
Member

chelmuth commented May 4, 2023

I deleted /var/tmp/build-23.05/bootstrap and built from scratch without errors. Hooray 🥳

cproc added a commit to cproc/genode that referenced this issue May 8, 2023
cproc added a commit to cproc/genode that referenced this issue May 8, 2023
chelmuth added a commit that referenced this issue May 30, 2023
error: 'void operator delete(void*, Genode::Deallocator&)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]

Issue #4827
Fixes #4850
chelmuth pushed a commit that referenced this issue May 30, 2023
chelmuth pushed a commit that referenced this issue May 30, 2023
chelmuth pushed a commit that referenced this issue May 30, 2023
chelmuth pushed a commit that referenced this issue May 30, 2023
chelmuth added a commit that referenced this issue May 30, 2023
ld: warning: hypervisor has a LOAD segment with RWX permissions

Issue #4827
chelmuth pushed a commit that referenced this issue May 30, 2023
chelmuth pushed a commit that referenced this issue May 30, 2023
Dynamically linked functions can not be called directly with jump ("j",
"jal") and friends. Calls must go through the PLT.

issue #4827
chelmuth pushed a commit that referenced this issue May 30, 2023
Eliminate the creation of 'Genode::String's before the linker has been
self relocated, because 'Genode::String's will call 'Genode::strlen' on
construction from C-Strings, which has now become a GOT relative call,
while the GOT contains only zeros before relocation -> page fault at
IP 0.

fixes #4867
related to #4827
chelmuth added a commit that referenced this issue May 30, 2023
/data/genode/repos/os/src/server/lx_fs/directory.h: In member function ‘virtual Genode::size_t Lx_fs::Directory::read(char*, Genode::size_t, File_system::seek_off_t)’:
/data/genode/repos/os/src/server/lx_fs/directory.h:224:53: error: ‘dent’ may be used uninitialized [-Werror=maybe-uninitialized]
  224 |                                 .type  = type(dent->d_type),
      |                                               ~~~~~~^~~~~~
/data/genode/repos/os/src/server/lx_fs/directory.h:197:40: note: ‘dent’ was declared here
  197 |                         struct dirent *dent;
      |                                        ^~~~

Issue #4827
chelmuth pushed a commit that referenced this issue May 30, 2023
Either enable strict-alignment or disable FPU code generation by gcc
regarding bootstrap code, which cannot handle alignment faults during
initialization properly.

Ref #4827
chelmuth added a commit that referenced this issue May 30, 2023
The fixes were manually backported from virtualbox-trunk.

Issue #4827
Fixes #4846
chelmuth added a commit that referenced this issue May 30, 2023
chelmuth added a commit that referenced this issue May 30, 2023
chelmuth added a commit that referenced this issue May 30, 2023
chelmuth added a commit that referenced this issue May 30, 2023
chelmuth pushed a commit that referenced this issue May 30, 2023
chelmuth added a commit that referenced this issue May 30, 2023
In our binaries, the .note.GNU-stack section is missing, which is okay
as we do not interpret these sections anyway and map stack pages
non-executable per default.

Issue #4827
@nfeske
Copy link
Member

nfeske commented May 30, 2023

Fixed in master.

@nfeske nfeske closed this as completed May 30, 2023
chelmuth added a commit to genodelabs/genode-imx that referenced this issue May 31, 2023
chelmuth pushed a commit to genodelabs/genode-imx that referenced this issue May 31, 2023
Enable strict-alignment to compile bootstrap code, which cannot handle
alignment faults during initialization properly.

Ref genodelabs/genode#4827
atopia added a commit to atopia/goa that referenced this issue Sep 13, 2023
Since genodelabs/genode#4827, the linker may resolve it's `-lc` argument
to the shared `libc.lib.so` library.

To make sure that the versioned symbols are statically linked to the
binary, put them in `libutil.a`, as `libutil.lib.so` is not a commonly
used library name on Genode.

Ref: genodelabs#63
jschlatow pushed a commit to genodelabs/goa that referenced this issue Sep 22, 2023
Since genodelabs/genode#4827, the linker may resolve it's `-lc` argument
to the shared `libc.lib.so` library.

To make sure that the versioned symbols are statically linked to the
binary, put them in `libutil.a`, as `libutil.lib.so` is not a commonly
used library name on Genode.

Ref: #63
jschlatow pushed a commit to genodelabs/goa that referenced this issue Oct 13, 2023
Since genodelabs/genode#4827, the linker may resolve it's `-lc` argument
to the shared `libc.lib.so` library.

To make sure that the versioned symbols are statically linked to the
binary, put them in `libutil.a`, as `libutil.lib.so` is not a commonly
used library name on Genode.

Ref: #63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants