Skip to contentSkip to conversation

MSYS2 and libfdt

DISCUSSION Thomas Huth 5 participants 15 messages Jan 19, 2023 – Jan 25, 2023

lore
Share & tools
lore
#0 lore raw

Hi all,

in some spare minutes, I started playing with a patch to try to remove the dtc submodule from the QEMU git repository - according to https://repology.org/project/dtc/versions our supported build platforms should now all provide the minimum required version.

However, I'm hitting a problem with Windows / MSYS2 in the CI jobs: The libfdt is packaged as part of the dtc package there:

https://packages.msys2.org/package/dtc

... meaning that it is added with a usr/include and usr/lib path prefix instead of mingw64/include and mingw64/lib like other packages are using (see e.g. https://packages.msys2.org/package/mingw-w64-x86_64-zlib?repo=mingw64). Thus the compiler does not find the library there. Also there does not seem to be a difference between a i686 (32-bit) and x86_64 (64-bit) variant available here? Does anybody know how libfdt is supposed to be used with MSYS2 ?

Thomas

#1 lore raw

Am 19.01.23 um 09:14 schrieb Thomas Huth:

Quoted 5 lines

 Hi all,

in some spare minutes, I started playing with a patch to try to remove the dtc submodule from the QEMU git repository - according to https://repology.org/project/dtc/versions our supported build platforms should now all provide the minimum required version.

Quoted 7 lines

However, I'm hitting a problem with Windows / MSYS2 in the CI jobs: The libfdt is packaged as part of the dtc package there:

 https://packages.msys2.org/package/dtc

... meaning that it is added with a usr/include and usr/lib path prefix instead of mingw64/include and mingw64/lib like other packages are using (see e.g. https://packages.msys2.org/package/mingw-w64-x86_64-zlib?repo=mingw64). Thus the compiler does not find the library there. Also there does not seem to be a difference between a i686 (32-bit) and x86_64 (64-bit) variant available here? Does anybody know how libfdt is supposed to be used with MSYS2 ?

 Thomas

Hi Thomas,

"dtc" is not the right package for cross builds. We'd require mingw-w64-i686-dtc and mingw-w64-x86_64-dtc packages for the QEMU build, but those packages are currently not provided by MSYS2.

See https://packages.msys2.org/search?t=binpkg&q=zlib for the zlib packages and related cross build packages.

Stefan

#2 lore raw
Quoted 11 lines · Stefan Weil

Am 19.01.23 um 09:14 schrieb Thomas Huth:

Quoted 9 lines

 Hi all,

in some spare minutes, I started playing with a patch to try to remove the dtc submodule from the QEMU git repository - according to https://repology.org/project/dtc/versions our supported build platforms should now all provide the minimum required version.

However, I'm hitting a problem with Windows / MSYS2 in the CI jobs: The libfdt is packaged as part of the dtc package there:

 https://packages.msys2.org/package/dtc

Quoted 8 lines
Quoted 3 lines

... meaning that it is added with a usr/include and usr/lib path prefix instead of mingw64/include and mingw64/lib like other packages are using (see e.g. https://packages.msys2.org/package/mingw-w64-x86_64-zlib?repo=mingw64). Thus the compiler does not find the library there. Also there does not seem to be a difference between a i686 (32-bit) and x86_64 (64-bit) variant available here? Does anybody know how libfdt is supposed to be used with MSYS2 ?

 Thomas

Hi Thomas,

"dtc" is not the right package for cross builds. We'd require mingw-w64-i686-dtc and mingw-w64-x86_64-dtc packages for the QEMU build, but those packages are currently not provided by MSYS2.

Ok, thanks ... so that basically means we cannot get rid of the dtc submodule yet.

Thomas

#3 lore raw
In reply to Thomas Huth

Hi

Quoted 14 lines · Thomas Huth

Hi all,

in some spare minutes, I started playing with a patch to try to remove the dtc submodule from the QEMU git repository - according to
https://repology.org/project/dtc/versions our supported build platforms should now all provide the minimum required version.

However, I'm hitting a problem with Windows / MSYS2 in the CI jobs: The libfdt is packaged as part of the dtc package there:

https://packages.msys2.org/package/dtc

Quoted 7 lines

... meaning that it is added with a usr/include and usr/lib path prefix instead of mingw64/include and mingw64/lib like other packages are using (see e.g.
https://packages.msys2.org/package/mingw-w64-x86_64-zlib?repo=mingw64). Thus the compiler does not find the library there. Also there does not seem to be a difference between a i686 (32-bit) and x86_64 (64-bit) variant available here? Does anybody know how libfdt is supposed to be used with MSYS2 ?

The msys environment is a bit special, it's not an environment for a particular build target, my understanding is that it holds common files/tools.

dtc should be added to https://github.com/msys2/MINGW-packages for it to be available as a target dependency.

Signature · 1 line
Marc-André Lureau
#4 lore raw
Quoted 25 lines · Marc-André Lureau

Hi

Quoted 14 lines · Thomas Huth

Hi all,

in some spare minutes, I started playing with a patch to try to remove the dtc submodule from the QEMU git repository - according to
https://repology.org/project/dtc/versions our supported build platforms should now all provide the minimum required version.

However, I'm hitting a problem with Windows / MSYS2 in the CI jobs: The libfdt is packaged as part of the dtc package there:

https://packages.msys2.org/package/dtc

Quoted 7 lines

... meaning that it is added with a usr/include and usr/lib path prefix instead of mingw64/include and mingw64/lib like other packages are using (see e.g.
https://packages.msys2.org/package/mingw-w64-x86_64-zlib?repo=mingw64). Thus the compiler does not find the library there. Also there does not seem to be a difference between a i686 (32-bit) and x86_64 (64-bit) variant available here? Does anybody know how libfdt is supposed to be used with MSYS2 ?

Quoted 6 lines

The msys environment is a bit special, it's not an environment for a particular build target, my understanding is that it holds common files/tools.

dtc should be added to https://github.com/msys2/MINGW-packages for it to be available as a target dependency.

Do you have already any experience in requesting a new package there? Could you maybe do it? ... since I don't have a proper MinGW installation here, it would be very cumbersome for me right now.

Thomas

#5 lore raw

Hi Thomas

Quoted 31 lines · Thomas Huth
Quoted 29 lines · Marc-André Lureau

Hi

Quoted 14 lines · Thomas Huth

Hi all,

in some spare minutes, I started playing with a patch to try to remove the dtc submodule from the QEMU git repository - according to
https://repology.org/project/dtc/versions our supported build platforms should now all provide the minimum required version.

However, I'm hitting a problem with Windows / MSYS2 in the CI jobs: The libfdt is packaged as part of the dtc package there:

https://packages.msys2.org/package/dtc

Quoted 7 lines

... meaning that it is added with a usr/include and usr/lib path prefix instead of mingw64/include and mingw64/lib like other packages are using (see e.g.
https://packages.msys2.org/package/mingw-w64-x86_64-zlib?repo=mingw64). Thus the compiler does not find the library there. Also there does not seem to be a difference between a i686 (32-bit) and x86_64 (64-bit) variant available here? Does anybody know how libfdt is supposed to be used with MSYS2 ?

The msys environment is a bit special, it's not an environment for a particular build target, my understanding is that it holds common files/tools.

Quoted 7 lines
Quoted 2 lines

dtc should be added to https://github.com/msys2/MINGW-packages for it to be available as a target dependency.

Do you have already any experience in requesting a new package there? Could you maybe do it? ... since I don't have a proper MinGW installation here, it would be very cumbersome for me right now.

Here you go (although let see what CI has to say):
https://github.com/msys2/MINGW-packages/pull/15168

The msys2 maintainers are usually very quick and helpful, in my experience.

(I sometime use a windev evaluation VM, that I import with the help of
https://github.com/elmarco/virt-install-windev)

Signature · 1 line
Marc-André Lureau
#6 lore raw
Quoted 42 lines · Marc-André Lureau

Hi Thomas

Quoted 31 lines · Thomas Huth
Quoted 29 lines · Marc-André Lureau

Hi

Quoted 14 lines · Thomas Huth

Hi all,

in some spare minutes, I started playing with a patch to try to remove the dtc submodule from the QEMU git repository - according to
https://repology.org/project/dtc/versions our supported build platforms should now all provide the minimum required version.

However, I'm hitting a problem with Windows / MSYS2 in the CI jobs: The libfdt is packaged as part of the dtc package there:

https://packages.msys2.org/package/dtc

Quoted 7 lines

... meaning that it is added with a usr/include and usr/lib path prefix instead of mingw64/include and mingw64/lib like other packages are using (see e.g.
https://packages.msys2.org/package/mingw-w64-x86_64-zlib?repo=mingw64). Thus the compiler does not find the library there. Also there does not seem to be a difference between a i686 (32-bit) and x86_64 (64-bit) variant available here? Does anybody know how libfdt is supposed to be used with MSYS2 ?

The msys environment is a bit special, it's not an environment for a particular build target, my understanding is that it holds common files/tools.

Quoted 7 lines
Quoted 2 lines

dtc should be added to https://github.com/msys2/MINGW-packages for it to be available as a target dependency.

Do you have already any experience in requesting a new package there? Could you maybe do it? ... since I don't have a proper MinGW installation here, it would be very cumbersome for me right now.

Quoted 4 lines

Here you go (although let see what CI has to say):
https://github.com/msys2/MINGW-packages/pull/15168

The msys2 maintainers are usually very quick and helpful, in my experience.

And it merged 1 day after you posted it. So yes, the msys2 maintainers are indeed very quick & helpful :-)

So in theory we can try to drop the submodule for dtc now

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#7 lore raw
Quoted 42 lines · Daniel P. Berrangé
Quoted 41 lines · Marc-André Lureau

Hi Thomas

Quoted 37 lines · Thomas Huth
Quoted 24 lines · Marc-André Lureau

Hi

Quoted 13 lines · Thomas Huth

Hi all,

in some spare minutes, I started playing with a patch to try to remove the dtc submodule from the QEMU git repository - according to
https://repology.org/project/dtc/versions our supported build platforms should now all provide the minimum required version.

However, I'm hitting a problem with Windows / MSYS2 in the CI jobs: The libfdt is packaged as part of the dtc package there:

https://packages.msys2.org/package/dtc

Quoted 7 lines

... meaning that it is added with a usr/include and usr/lib path prefix instead of mingw64/include and mingw64/lib like other packages are using (see e.g.
https://packages.msys2.org/package/mingw-w64-x86_64-zlib?repo=mingw64). Thus the compiler does not find the library there. Also there does not seem to be a difference between a i686 (32-bit) and x86_64 (64-bit) variant available here? Does anybody know how libfdt is supposed to be used with MSYS2 ?

Quoted 6 lines

The msys environment is a bit special, it's not an environment for a particular build target, my understanding is that it holds common files/tools.

dtc should be added to https://github.com/msys2/MINGW-packages for it to be available as a target dependency.

Do you have already any experience in requesting a new package there? Could you maybe do it? ... since I don't have a proper MinGW installation here, it would be very cumbersome for me right now.

Quoted 4 lines
Quoted 4 lines

Here you go (although let see what CI has to say):
https://github.com/msys2/MINGW-packages/pull/15168

The msys2 maintainers are usually very quick and helpful, in my experience.

Great, I just gave it a try, and it seems to be working, indeed:

https://gitlab.com/thuth/qemu/-/jobs/3649509495#L668

Thank you very much Marc-André and Biswapriyo!

Quoted 4 lines

And it merged 1 day after you posted it. So yes, the msys2 maintainers are indeed very quick & helpful :-)

So in theory we can try to drop the submodule for dtc now

Ok, I'll give my patch another try to see whether all the other systems have a usable version of libfdt available, too.

Thomas

#8 lore raw

NetBSD and libfdt (was: Re: MSYS2 and libfdt)

On 24/01/2023 10.20, Thomas Huth wrote:
[...]

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines · Thomas Huth
Quoted 7 lines

    Hi all,

in some spare minutes, I started playing with a patch to try to remove the dtc submodule from the QEMU git repository - according to
https://repology.org/project/dtc/versions our supported build platforms should now all provide the minimum required version.

[...]

Quoted 1 line

Ok, I'll give my patch another try to see whether all the other systems have a usable version of libfdt available, too.

... and I apparently missed NetBSD in my first research: Looks like NetBSD is still using dtc v1.4.7 which is too old for QEMU. (though https://www.netbsd.org/docs/software/3rdparty/ talks about v1.5.1, I only get dtc 1.4.7 in our NetBSD VM).

Reinoud, Ryo, any chance that you could get dtc updated to a newer version (at least 1.5.1) in NetBSD ?

Thanks,
Thomas

#9 lore raw

Re: NetBSD and libfdt (was: Re: MSYS2 and libfdt)

hi,

Quoted 6 lines · Thomas Huth

On 24/01/2023 10.20, Thomas Huth wrote:
[...]

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines · Thomas Huth
Quoted 3 lines

    Hi all,

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

in some spare minutes, I started playing with a patch to try to remove the dtc submodule from the QEMU git repository - according to
https://repology.org/project/dtc/versions our supported build platforms should now all provide the minimum required version.

[...]

Quoted 1 line

Ok, I'll give my patch another try to see whether all the other systems have a usable version of libfdt available, too.

... and I apparently missed NetBSD in my first research: Looks like NetBSD is still using dtc v1.4.7 which is too old for QEMU. (though https://www.netbsd.org/docs/software/3rdparty/ talks about v1.5.1, I only get dtc 1.4.7 in our NetBSD VM).

The not yet released netbsd-10 and -current have 1.5.1. Perhaps you can use netbsd-10 for your VM?

Thanks,
Nick

#10 lore raw

Re: NetBSD and libfdt

Quoted 13 lines · Nick Hudson

hi,

Quoted 10 lines · Thomas Huth

On 24/01/2023 10.20, Thomas Huth wrote:
[...]

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines · Thomas Huth
Quoted 7 lines

    Hi all,

in some spare minutes, I started playing with a patch to try to remove the dtc submodule from the QEMU git repository - according to
https://repology.org/project/dtc/versions our supported build platforms should now all provide the minimum required version.

Quoted 6 lines
Quoted 4 lines

[...]

Quoted 1 line

Ok, I'll give my patch another try to see whether all the other systems have a usable version of libfdt available, too.

... and I apparently missed NetBSD in my first research: Looks like NetBSD is still using dtc v1.4.7 which is too old for QEMU. (though https://www.netbsd.org/docs/software/3rdparty/ talks about v1.5.1, I only get dtc 1.4.7 in our NetBSD VM).

The not yet released netbsd-10 and -current have 1.5.1. Perhaps you can use netbsd-10 for your VM?

Ah, ok, thanks, I didn't know yet that NetBSD 10 is just about to get released (hopefully?) soon...
Anyway, even if it gets released this year, it means we have to carry the dtc submodule in QEMU for two more years according to our support policy:

https://www.qemu.org/docs/master/about/build-platforms.html#linux-os-macos-freebsd-netbsd-openbsd

(since NetBSD will be supported by QEMU for two more years)

Will there be another minor release of NetBSD 9 where it would be possible to update dtc to at least version 1.5.1, too?

Thanks,
Thomas

#11 lore raw

MinGW and libfdt (was: Re: MSYS2 and libfdt)

In reply to Daniel P. Berrangé
Quoted 1 line · Daniel P. Berrangé

On Fri, Jan 20, 2023 at 05:57:29PM +0400, Marc-André Lureau wrote:

...

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines · Thomas Huth
Quoted 8 lines

Hi all,

in some spare minutes, I started playing with a patch to try to remove the dtc submodule from the QEMU git repository - according to
https://repology.org/project/dtc/versions our supported build platforms should now all provide the minimum required version.

...

Quoted 1 line

So in theory we can try to drop the submodule for dtc now

The dtc package is also still missing in the MinGW cross compiler suite in Fedora ... does anybody know what's the right way to request it there?

Thomas

#12 lore raw

Re: MinGW and libfdt (was: Re: MSYS2 and libfdt)

Quoted 12 lines · Thomas Huth
Quoted 1 line · Daniel P. Berrangé

On Fri, Jan 20, 2023 at 05:57:29PM +0400, Marc-André Lureau wrote:

...

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines · Thomas Huth
Quoted 8 lines

Hi all,

in some spare minutes, I started playing with a patch to try to remove the dtc submodule from the QEMU git repository - according to
https://repology.org/project/dtc/versions our supported build platforms should now all provide the minimum required version.

Quoted 5 lines

...

Quoted 1 line

So in theory we can try to drop the submodule for dtc now

The dtc package is also still missing in the MinGW cross compiler suite in Fedora ... does anybody know what's the right way to request it there?

Someone will need to write a specfile, and submit it for review. I can do the submission, or the review, but not both (can't mark your own homework)

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#13 lore raw

Re: MinGW and libfdt (was: Re: MSYS2 and libfdt)

Hi

Quoted 14 lines · Daniel P. Berrangé
Quoted 12 lines · Thomas Huth
Quoted 1 line · Daniel P. Berrangé

On Fri, Jan 20, 2023 at 05:57:29PM +0400, Marc-André Lureau wrote:

...

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines · Thomas Huth
Quoted 8 lines

Hi all,

in some spare minutes, I started playing with a patch to try to remove the dtc submodule from the QEMU git repository - according to
https://repology.org/project/dtc/versions our supported build platforms should now all provide the minimum required version.

Quoted 9 lines
Quoted 5 lines

...

Quoted 1 line

So in theory we can try to drop the submodule for dtc now

The dtc package is also still missing in the MinGW cross compiler suite in Fedora ... does anybody know what's the right way to request it there?

Someone will need to write a specfile, and submit it for review. I can do the submission, or the review, but not both (can't mark your own homework)

It's already been in rawhide for a few months. We can probably merge and update f37.
https://packages.fedoraproject.org/pkgs/dtc/dtc/

Signature · 1 line
Marc-André Lureau
#14 lore raw

Re: MinGW and libfdt (was: Re: MSYS2 and libfdt)

Quoted 23 lines · Marc-André Lureau

Hi

Quoted 20 lines · Daniel P. Berrangé
Quoted 17 lines · Thomas Huth
Quoted 1 line · Daniel P. Berrangé

On Fri, Jan 20, 2023 at 05:57:29PM +0400, Marc-André Lureau wrote:

...

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines · Thomas Huth
Quoted 8 lines

Hi all,

in some spare minutes, I started playing with a patch to try to remove the dtc submodule from the QEMU git repository - according to
https://repology.org/project/dtc/versions our supported build platforms should now all provide the minimum required version.

...

Quoted 1 line

So in theory we can try to drop the submodule for dtc now

The dtc package is also still missing in the MinGW cross compiler suite in Fedora ... does anybody know what's the right way to request it there?

Quoted 7 lines
Quoted 3 lines

Someone will need to write a specfile, and submit it for review. I can do the submission, or the review, but not both (can't mark your own homework)

It's already been in rawhide for a few months. We can probably merge and update f37.
https://packages.fedoraproject.org/pkgs/dtc/dtc/

Ah, great, good to know that it is on its way already. Even if this only gets released in F38 this still should be fine ... F38 is not that far away anymore.

Thomas