Re: dlmalloc CC0 license (was Re: Packaging a cross-compilation environment (wasi-libc))

2023-08-10 Thread Jan Staněk
Hi Daniel,

"Daniel P. Berrangé"  writes:
> I'm reviewing another package (sgxsdk) which also includes a copy
> of dlmalloc with the CC0 license declaration. I wondered if you
> ever made contact with Doug Lea around this question ?

I recall trying to reach him via mail and not being successful;
however, since at that time we were pivoting to use another malloc
implementation, I did not push that very far (i.e. trying to find other
e-mails than the one from changelog).
--
Jan Staněk
Software Engineer, Red Hat
jsta...@redhat.com   irc: jstanek


signature.asc
Description: PGP signature
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


dlmalloc CC0 license (was Re: Packaging a cross-compilation environment (wasi-libc))

2023-08-02 Thread Daniel P . Berrangé
Bringing a year old thread back from the dead...

On Mon, Aug 29, 2022 at 06:54:35AM -0700, Jan Staněk wrote:
> Florian Weimer  writes:
> > You can try to replace the current version with dlmalloc 2.7.2, which
> > still comes with the previous public domain dedication:
> >
> >   

IIUC, it is not required to go all the way back to 2.7.2. The
version 2.8.3 has the older creative commons public domain
dedication - https://spdx.org/licenses/CC-PDDC.html which
is permitted in Fedora.

> > We can also ask Doug Lea if he can go back to the previous public domain
> > dedication.
> 
> I've got some comments on the wasi-libc issue that another malloc might
> work as well. Nevertheless, I'll try to contact Doug Lea with the
> explanation and see where that leads.

I'm reviewing another package (sgxsdk) which also includes a copy
of dlmalloc with the CC0 license declaration. I wondered if you
ever made contact with Doug Lea around this question ?

With regards,
Daniel
-- 
|: 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 :|
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Packaging a cross-compilation environment (wasi-libc)

2022-10-27 Thread Jun Aruga (he / him)
On Mon, Oct 24, 2022 at 1:19 PM Jan Staněk  wrote:
>
> Hi Jun,
>
> "Jun Aruga (he / him)"  writes:
> > Do you have a plan to create the RPM package for wasi-sdk[1]?
>
> Not really, since we already (almost) have it available :)
>
> The wasi-sdk consists of llvm toolchain (clang & friends) compiled so
> that it can emit WASM code, and the wasi-libc, which implements standard
> C library atop WebAssembly System Interface "syscalls".
>
> Fedora's clang is already capable of emitting wasm
> (`clang --target=wasm32-wasi -nostdlib …` works), so I see no need to
> package it again. The thing we are missing is the wasi-libc,
> which I aimed to package.
>
> In other words, packaging wasi-sdk seems redundant to me
> – you would have to maintain separate version of clang,
> while the Fedora one is already able to compile what you need.
> We still need the C lib.
>
> Unfortunately, recent NodeJS releases had me occupied pretty much entirely,
> so I was unable to work on this.
> I hope I can get back to it this week. Fingers crossed.

Hi Jan,
Thanks for sharing the info.
I understand that when the clang supports the WASI (wasm32-wasi)
target, we don't need to build wasi-sdk or use the wasi-sdk RPM
package. It's just redundant.
Our encouraged way to use WebAssembly from Ruby can be to build the
Ruby source with the `clang --target=wasm32-wasi -nostdlib …` without
using the Ruby RPM.

> > But I
> > feel it takes more than 60 minutes, and is still in progress.
> > I wonder how other program languages supporting WebAssembly manage
> > this situation.
>
> Yeah, building entire compiler toolchain takes a while :)
>
> I had a COPR of the WIP wasi-sdk, but I set it to expire automatically,
> so it is currently not available. I'll try to spin in back up today
> and send you a link, in case you want to start testing the Ruby stuff
> with it already.
>
> Have a nice day!

As I see building Ruby with the WASI (wasm32-wasi) target on clang (or
wasi-sdk) is exclusive with the current normal built Ruby on GCC in
the Ruby RPM. I have no plan to include the WASI target build in the
current Ruby RPM package. I have already tested the Ruby built from
source with the wasi-sdk. That's ok for now. I don't need additional
tests for now. Thanks.

-- 
Jun | He - Him | Timezone: UTC+1 or 2, Czech Republic
See  for
the timezone.
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Packaging a cross-compilation environment (wasi-libc)

2022-10-24 Thread Jan Staněk
Hi Jun,

"Jun Aruga (he / him)"  writes:
> Do you have a plan to create the RPM package for wasi-sdk[1]?

Not really, since we already (almost) have it available :)

The wasi-sdk consists of llvm toolchain (clang & friends) compiled so
that it can emit WASM code, and the wasi-libc, which implements standard
C library atop WebAssembly System Interface "syscalls".

Fedora's clang is already capable of emitting wasm
(`clang --target=wasm32-wasi -nostdlib …` works), so I see no need to
package it again. The thing we are missing is the wasi-libc,
which I aimed to package.

In other words, packaging wasi-sdk seems redundant to me
– you would have to maintain separate version of clang,
while the Fedora one is already able to compile what you need.
We still need the C lib.

Unfortunately, recent NodeJS releases had me occupied pretty much entirely,
so I was unable to work on this.
I hope I can get back to it this week. Fingers crossed.

> But I
> feel it takes more than 60 minutes, and is still in progress.
> I wonder how other program languages supporting WebAssembly manage
> this situation.

Yeah, building entire compiler toolchain takes a while :)

I had a COPR of the WIP wasi-sdk, but I set it to expire automatically,
so it is currently not available. I'll try to spin in back up today
and send you a link, in case you want to start testing the Ruby stuff
with it already.

Have a nice day!
--
Jan Staněk
Software Engineer, Red Hat
jsta...@redhat.com   irc: jstanek


signature.asc
Description: PGP signature
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Packaging a cross-compilation environment (wasi-libc)

2022-10-20 Thread Jun Aruga (he / him)
> So, I am building the wasi-sdk from the source on Fedora 36. But I
> feel it takes more than 60 minutes, and is still in progress.
> I wonder how other program languages supporting WebAssembly manage
> this situation.

I just finished building the source. The building time was 60 minutes.

```
$ history
...
 3095  2022-10-20 16:53:44 NINJA_FLAGS=-v make package
 3096  2022-10-20 17:53:04 date
...
```

-- 
Jun | He - Him | Timezone: UTC+1 or 2, Czech Republic
See  for
the timezone.
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Packaging a cross-compilation environment (wasi-libc)

2022-10-20 Thread Jun Aruga (he / him)
Hi Jan,

Thanks for the work around WebAssembly.
Do you have a plan to create the RPM package for wasi-sdk[1]?

The coming Ruby new version 3.2 supports WebAssembly, and it requires
wasi-sdk to use it.[2]
But the released wasi-sdk binaries on the upstream project don't have
the binary compatibility on the Fedora, because the binaries are built
on the Ubuntu environment.[4]
So, I am building the wasi-sdk from the source on Fedora 36. But I
feel it takes more than 60 minutes, and is still in progress.
I wonder how other program languages supporting WebAssembly manage
this situation.

[1] https://github.com/WebAssembly/wasi-sdk
[2] https://github.com/ruby/ruby/blob/master/wasm/README.md
[3] https://github.com/WebAssembly/wasi-sdk/releases
[4] https://bugs.ruby-lang.org/issues/19053#note-2

On Mon, Aug 29, 2022 at 4:04 PM Jan Staněk  wrote:
>
> To better collaborate on this, I've pushed my working copy of the
> package to gitlab [1]. It's a bit experimental (i.e. it tries to use
> source-git [2] approach to development), but should allow any
> interested party to review what I'm doing :)
>
> Integration with COPR is on my TODO list.
>
> [1]: https://gitlab.com/khx/fedora/wasi-libc
> [2]: https://docs.fedoraproject.org/en-US/ci/source-git/
>
> Florian Weimer  writes:
> > You can try to replace the current version with dlmalloc 2.7.2, which
> > still comes with the previous public domain dedication:
> >
> >   
> >
> > We can also ask Doug Lea if he can go back to the previous public domain
> > dedication.
>
> I've got some comments on the wasi-libc issue that another malloc might
> work as well. Nevertheless, I'll try to contact Doug Lea with the
> explanation and see where that leads.
>
> Thanks!
> --
> Jan Staněk
> Software Engineer, Red Hat
> jsta...@redhat.com   irc: jstanek
> ___
> devel mailing list -- devel@lists.fedoraproject.org
> To unsubscribe send an email to devel-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
> Do not reply to spam, report it: 
> https://pagure.io/fedora-infrastructure/new_issue



-- 
Jun | He - Him | Timezone: UTC+1 or 2, Czech Republic
See  for
the timezone.
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Packaging a cross-compilation environment (wasi-libc)

2022-08-29 Thread Jan Staněk
To better collaborate on this, I've pushed my working copy of the
package to gitlab [1]. It's a bit experimental (i.e. it tries to use
source-git [2] approach to development), but should allow any
interested party to review what I'm doing :)

Integration with COPR is on my TODO list.

[1]: https://gitlab.com/khx/fedora/wasi-libc
[2]: https://docs.fedoraproject.org/en-US/ci/source-git/

Florian Weimer  writes:
> You can try to replace the current version with dlmalloc 2.7.2, which
> still comes with the previous public domain dedication:
>
>   
>
> We can also ask Doug Lea if he can go back to the previous public domain
> dedication.

I've got some comments on the wasi-libc issue that another malloc might
work as well. Nevertheless, I'll try to contact Doug Lea with the
explanation and see where that leads.

Thanks!
--
Jan Staněk
Software Engineer, Red Hat
jsta...@redhat.com   irc: jstanek


signature.asc
Description: PGP signature
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Packaging a cross-compilation environment (wasi-libc)

2022-08-29 Thread Florian Weimer
* Jan Staněk:

> The main issue I'm fighting with currently is the CC0-licensed dlmalloc
> and it's possible replacement with the musl one.
> It seems that the dlmalloc is used mainly because it does not need
> a mmap-like capabilities on the system; WebAssembly does not provide that.
> I'm yet to succesfully compile the libc with any other malloc
> implementation – any help or pointers appreciated.

You can try to replace the current version with dlmalloc 2.7.2, which
still comes with the previous public domain dedication:

  

We can also ask Doug Lea if he can go back to the previous public domain
dedication.

Thanks,
Florian
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Packaging a cross-compilation environment (wasi-libc)

2022-08-29 Thread Jan Staněk
Hello all again!

Some good news: With a gentle poking [1], the wasi-libc now have a
tagged version(s) - or at least tags corresponding to the version
used in a WASI-SDK. That should help us better agreement on which
version to use down the road.

[1]: https://github.com/WebAssembly/wasi-libc/issues/317

Josh Stone  writes:
> It might be fine to share this, as long as you are not patching upstream
> wasi-libc in some weird way. Rust's use is pretty minimal from vanilla
> sources, and mostly only updated when we need compatibility to build
> with a new Clang, in wasi-libc's Makefile "check-symbols" target.

I'm hoping we will be able to build it as-is; the only thing I'm now
currently patching is the Makefile, so that it picks up CFLAGS from
the environment. These flags get filtered to only those applicable
to the wasm32-wasi target.

The main issue I'm fighting with currently is the CC0-licensed dlmalloc
and it's possible replacement with the musl one.
It seems that the dlmalloc is used mainly because it does not need
a mmap-like capabilities on the system; WebAssembly does not provide that.
I'm yet to succesfully compile the libc with any other malloc
implementation – any help or pointers appreciated.

I've also opened an inquiry about this upstream [3];
we'll see how that goes.

[3]: https://github.com/WebAssembly/wasi-libc/issues/319
--
Jan Staněk
Software Engineer, Red Hat
jsta...@redhat.com   irc: jstanek


signature.asc
Description: PGP signature
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Packaging a cross-compilation environment (wasi-libc)

2022-08-22 Thread Josh Stone
On 8/22/22 5:35 AM, Florian Weimer wrote:
> * Jan Staněk:
> 
>> Hi list,
>> in order to be able to compile WASM natively on Fedora,
>> I'm trying to package wasi-libc[1] to provide the Web Assembly System
>> Interface.
>>
>> [1]: https://github.com/WebAssembly/wasi-libc
>>
>> My trouble is that this is in essence a cross-compilation environment,
>> and I have zero experience in trying to package these.
>> Also, I did not have much luck in trying to find any related
>> documentation.
> 
> Cc:ing Josh because Rust apparently already builds wasi-libc.
> 
> I doubt that right now, one static build of wasi-libc will be able to
> support both the Rust use cases and the NodeJS use case.  The versions
> will likely be different, and the WASI interfaces are still evolving.
> So if you package this separately, you probably should use paths with
> “nodejs” in the name.

It might be fine to share this, as long as you are not patching upstream
wasi-libc in some weird way. Rust's use is pretty minimal from vanilla
sources, and mostly only updated when we need compatibility to build
with a new Clang, in wasi-libc's Makefile "check-symbols" target.
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Packaging a cross-compilation environment (wasi-libc)

2022-08-22 Thread Florian Weimer
* Jan Staněk:

> Hi list,
> in order to be able to compile WASM natively on Fedora,
> I'm trying to package wasi-libc[1] to provide the Web Assembly System
> Interface.
>
> [1]: https://github.com/WebAssembly/wasi-libc
>
> My trouble is that this is in essence a cross-compilation environment,
> and I have zero experience in trying to package these.
> Also, I did not have much luck in trying to find any related
> documentation.

Cc:ing Josh because Rust apparently already builds wasi-libc.

I doubt that right now, one static build of wasi-libc will be able to
support both the Rust use cases and the NodeJS use case.  The versions
will likely be different, and the WASI interfaces are still evolving.
So if you package this separately, you probably should use paths with
“nodejs” in the name.

Another alternative would be to build wasi-libc from sources during the
NodeJS build, with the wasi-libc source either packaged separatedly, or
bundled with the NodeJS sources.  The former is how Go and Rust source
builds work in Fedora, so it's not that unusual.

> Some issues I have run into so far:
>
> - This is a libc implementation, which would probably conflict with the
>   glibc package by default. Looking at musl, the solution seems to be to
>   install into `/usr/{target}` prefix (i.e.  `/usr/wasm32-wasi/include`).
>   Not really sure how this works, any pointers appreciated.

Note that wasi-libc swaps out musl's malloc for dlmalloc, which is
licensed under the CC0 license, and this is no longer considered a
Fedora-compatible software license.

> - Clang seems to have issue with `-fstack-clash-protection` flag for the
>   `wasm32-wasi` target. What's the proper way to adjust these?

You cannot use the Fedora build flags for WASI because it's not a
GNU/Linux target.  I don't know what WASI (or WebAssembly) do to emulate
-fstack-clash-protection.  In theory, compiling for WASI could produce
explicit bounds checks for the addressable stack, which has to be
visible in addressable memory for C/C++ compatibility.  This is probably
the only portable way to implement something like
-fstack-clash-protection because WebAssembly is supposed to be portable
to systems without a MMU.  Even a more traditional implementation of
stack clash protection would need support from the WASI layer because of
the page size requirements.

Thanks,
Florian
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Packaging a cross-compilation environment (wasi-libc)

2022-08-19 Thread Jan Staněk
Hi again,
thanks for all the suggestions! I'm taking the AVR approach so far;
if you want to play with my drafts, I have a experimental COPR:

https://copr.fedorainfracloud.org/coprs/jstanek/wasi-libc/

I plan to open a proper Fedora Review request on Monday;
right now, I'm a bit too tired to go through the bureaucracy 

Have a nice weekend!
--
Jan Staněk
Software Engineer, Red Hat
jsta...@redhat.com   irc: jstanek


signature.asc
Description: PGP signature
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Packaging a cross-compilation environment (wasi-libc)

2022-08-17 Thread Richard W.M. Jones
On Tue, Aug 16, 2022 at 03:12:55AM -0700, Jan Staněk wrote:
> Hi list,
> in order to be able to compile WASM natively on Fedora,
> I'm trying to package wasi-libc[1] to provide the Web Assembly System
> Interface.
> 
> [1]: https://github.com/WebAssembly/wasi-libc
> 
> My trouble is that this is in essence a cross-compilation environment,
> and I have zero experience in trying to package these.
> Also, I did not have much luck in trying to find any related
> documentation.
> 
> Some issues I have run into so far:
> 
> - This is a libc implementation, which would probably conflict with the
>   glibc package by default. Looking at musl, the solution seems to be to
>   install into `/usr/{target}` prefix (i.e.  `/usr/wasm32-wasi/include`).
>   Not really sure how this works, any pointers appreciated.
> 
> - Clang seems to have issue with `-fstack-clash-protection` flag for the
>   `wasm32-wasi` target. What's the proper way to adjust these?
> 
> Any additional tips on cross-compilation support in Fedora would also be
> appreciated :)

You might want to look at how mingw-* is packaged.

https://src.fedoraproject.org/rpms/mingw-filesystem
https://src.fedoraproject.org/rpms/mingw-binutils
https://src.fedoraproject.org/rpms/mingw-crt
https://src.fedoraproject.org/rpms/mingw-gcc
https://src.fedoraproject.org/rpms/mingw-headers
(etc)

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Packaging a cross-compilation environment (wasi-libc)

2022-08-16 Thread Fabio Valentini
On Tue, Aug 16, 2022 at 12:13 PM Jan Staněk  wrote:
>
> Hi list,
> in order to be able to compile WASM natively on Fedora,
> I'm trying to package wasi-libc[1] to provide the Web Assembly System
> Interface.
>
> [1]: https://github.com/WebAssembly/wasi-libc
>
> My trouble is that this is in essence a cross-compilation environment,
> and I have zero experience in trying to package these.
> Also, I did not have much luck in trying to find any related
> documentation.
>
> Some issues I have run into so far:
>
> - This is a libc implementation, which would probably conflict with the
>   glibc package by default. Looking at musl, the solution seems to be to
>   install into `/usr/{target}` prefix (i.e.  `/usr/wasm32-wasi/include`).
>   Not really sure how this works, any pointers appreciated.
>
> - Clang seems to have issue with `-fstack-clash-protection` flag for the
>   `wasm32-wasi` target. What's the proper way to adjust these?
>
> Any additional tips on cross-compilation support in Fedora would also be
> appreciated :)
>
> Thanks in advance for any help!

You might want to look into how rust packages its wasm32-wasi
cross-compilation toolchain.
I assume that wasi-libc would build an object for statically linking with?
rust-std-static-wasm32-wasi should be an equivalent thing when
cross-compiling Rust for wasm32-wasi.

Fabio
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue


Re: Packaging a cross-compilation environment (wasi-libc)

2022-08-16 Thread Dominik 'Rathann' Mierzejewski
Hello, Jan.

On Tuesday, 16 August 2022 at 12:12, Jan Staněk wrote:
> Hi list,
> in order to be able to compile WASM natively on Fedora,
> I'm trying to package wasi-libc[1] to provide the Web Assembly System
> Interface.
> 
> [1]: https://github.com/WebAssembly/wasi-libc
> 
> My trouble is that this is in essence a cross-compilation environment,
> and I have zero experience in trying to package these.
> Also, I did not have much luck in trying to find any related
> documentation.

I'd go and take a look at the existing cross-compilation targets like
musl or avr:
https://src.fedoraproject.org/rpms/musl/blob/rawhide/f/musl.spec
https://src.fedoraproject.org/rpms/avr-libc/blob/rawhide/f/avr-libc.spec

> Some issues I have run into so far:
> 
> - This is a libc implementation, which would probably conflict with the
>   glibc package by default. Looking at musl, the solution seems to be to
>   install into `/usr/{target}` prefix (i.e.  `/usr/wasm32-wasi/include`).
>   Not really sure how this works, any pointers appreciated.

That's correct. See 
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_filesystem_layout
Exceptions

* Fedora allows cross-compilers to place files in /usr/target.

> - Clang seems to have issue with `-fstack-clash-protection` flag for the
>   `wasm32-wasi` target. What's the proper way to adjust these?

You can filter them out. There was some discussion recently about
filtering troublesome flags from Fedora default flags:
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/SNV72TC5SDPUSQEVULKRKPIJE2ZMQUIP/

PS. I'm maintaining two WASM-related packages which I needed to build
some Firefox extensions from source: binaryen and wabt. I'm definitely
not a good maintainer for them as I know next to nothing about WASM.
I'd appreciate a co-maintainer who knows a bit about WASM.

Regards,
Dominik
-- 
Fedora   https://getfedora.org  |  RPM Fusion  http://rpmfusion.org
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue