Csound Csound-dev Csound-tekno Search About

[Csnd-dev] Moving the LuaJIT opcodes out of csound

Date2019-05-28 23:30
FromMichael Gogins
Subject[Csnd-dev] Moving the LuaJIT opcodes out of csound
I have pushed a remove_luajit branch of the csound develop branch that
removes the LuaJIT opcodes and their dependencies from the csound
repository. The Lua interface to Csound, and its dependency on the Lua
5.1 library and headers, remain.

I have rebuilt this branch for Ubuntu 18.04 and the native Android
libraries as well. I tried to build for WebAssembly but ran into what
appears to be a bug in the current build system for WebAssembly.

I don't plan to merge the remove_luajit branch until the WebAssembly
build succeeds.

Would you prefer that I fix up the WebAssembly build myself, or do you
want to try to build it in the remove_luajit branch?

Regards,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com

Date2019-05-29 05:27
FromSteven Yi
SubjectRe: [Csnd-dev] Moving the LuaJIT opcodes out of csound
I took a quick look for compiling with Emscripten and got errors after
upgrading Emscripten versions. I get the source of errors as pasted
below. Looks like there are issues where calls to lseek are expected
to be off_t in size, but there's either casts to int32_t or 0 (read as
int32_t since WASM is 32-bit) being used. Fix would be to add/change
casts to (off_t) I think in various places in codebase.

I'm travelling currently and unable to look further right now. If you
want to go for it, I'd suggest committing to the remove_luajit branch
to get AppVeyor build to run and perhaps get John or Victor to review
as it's mostly in the mp3 code before merging to develop.


^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
to 'lseek', should be i64
^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
should be i64
^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
to 'lseek', should be i64
^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
should be i64
^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
to 'lseek', should be i64
^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
should be i64
^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
to 'lseek', should be i64
^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
should be i64
^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
to 'lseek', should be i64
^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
should be i64
^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
to 'lseek', should be i64
^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
should be i64
^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
to 'lseek', should be i64
^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
should be i64
^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
to 'lseek', should be i64
^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
should be i64
^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
to 'lseek', should be i64
^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
should be i64
^[[0;33mwarning:^[[0m unexpected return type void in call to
'csound_orc_scan_buffer', should be %struct.yy_buffer_state*
^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
to 'lseek', should be i64
^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
should be i64
^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
to 'lseek', should be i64
^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
should be i64
^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
to 'lseek', should be i64
^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
should be i64
^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
to 'lseek', should be i64
^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
should be i64
^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
to 'ftruncate', should be i64
error: asm2wasm seeing an invalid argument type at index 1 (this will
not validate) in call from $_mp3dec_init_file to $_lseek (this is
likely d
ue to undefined behavior in C, like defining a function one way and
calling it in another, which is important to fix)
error: asm2wasm seeing an invalid argument type at index 1 (this will
not validate) in call from $_mp3dec_init_file to $_lseek (this is
likely d
ue to undefined behavior in C, like defining a function one way and
calling it in another, which is important to fix)
error: asm2wasm seeing an invalid argument type at index 1 (this will
not validate) in call from $_mp3dec_init_file to $_lseek (this is
likely d
ue to undefined behavior in C, like defining a function one way and
calling it in another, which is important to fix)
error: asm2wasm seeing an invalid argument type at index 1 (this will
not validate) in call from $_mp3dec_init_file to $_lseek (this is
likely d
ue to undefined behavior in C, like defining a function one way and
calling it in another, which is important to fix)
error: asm2wasm seeing an invalid argument type at index 1 (this will
not validate) in call from $_mp3dec_init_file to $_lseek (this is
likely d
ue to undefined behavior in C, like defining a function one way and
calling it in another, which is important to fix)
error: asm2wasm seeing an invalid argument type at index 1 (this will
not validate) in call from $_mp3dec_init_file to $_lseek (this is
likely d
ue to undefined behavior in C, like defining a function one way and
calling it in another, which is important to fix)
error: asm2wasm seeing an invalid argument type at index 1 (this will
not validate) in call from $_mp3dec_seek to $_lseek (this is likely
due to
 undefined behavior in C, like defining a function one way and calling
it in another, which is important to fix)
error: asm2wasm seeing an invalid argument type at index 1 (this will
not validate) in call from $_mp3dec_seek to $_lseek (this is likely
due to
 undefined behavior in C, like defining a function one way and calling
it in another, which is important to fix)
error: asm2wasm seeing an invalid argument type at index 1 (this will
not validate) in call from $_mp3dec_seek to $_lseek (this is likely
due to
 undefined behavior in C, like defining a function one way and calling
it in another, which is important to fix)
error: asm2wasm seeing an invalid argument type at index 1 (this will
not validate) in call from $_psf_ftell to $_lseek (this is likely due
to u
ndefined behavior in C, like defining a function one way and calling
it in another, which is important to fix)
error: asm2wasm seeing an invalid argument type at index 1 (this will
not validate) in call from $_psf_ftruncate to $_ftruncate (this is
likely
due to undefined behavior in C, like defining a function one way and
calling it in another, which is important to fix)
error: asm2wasm seeing an invalid argument type at index 1 (this will
not validate) in call from $_psf_fseek to $_lseek (this is likely due
to u
ndefined behavior in C, like defining a function one way and calling
it in another, which is important to fix)
error: asm2wasm seeing an invalid argument type at index 1 (this will
not validate) in call from $_psf_fseek to $_lseek (this is likely due
to undefined behavior in C, like defining a function one way and
calling it in another, which is important to fix)

On Tue, May 28, 2019 at 5:31 PM Michael Gogins  wrote:
>
> I have pushed a remove_luajit branch of the csound develop branch that
> removes the LuaJIT opcodes and their dependencies from the csound
> repository. The Lua interface to Csound, and its dependency on the Lua
> 5.1 library and headers, remain.
>
> I have rebuilt this branch for Ubuntu 18.04 and the native Android
> libraries as well. I tried to build for WebAssembly but ran into what
> appears to be a bug in the current build system for WebAssembly.
>
> I don't plan to merge the remove_luajit branch until the WebAssembly
> build succeeds.
>
> Would you prefer that I fix up the WebAssembly build myself, or do you
> want to try to build it in the remove_luajit branch?
>
> Regards,
> Mike
>
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com

Date2019-05-29 16:15
Fromjohn
SubjectRe: [Csnd-dev] Moving the LuaJIT opcodes out of csound
Changing the definition in InOut/libmpadec/mp3dec_internal.h line 37 to 
type off_t anfd adding (off_t) to a few of the calls to lseek(... 0. ...)
seems the correct thing to do.  I do not hve the ability to build 
enscripten versions to check


On Tue, 28 May 2019, Steven Yi wrote:

> I took a quick look for compiling with Emscripten and got errors after
> upgrading Emscripten versions. I get the source of errors as pasted
> below. Looks like there are issues where calls to lseek are expected
> to be off_t in size, but there's either casts to int32_t or 0 (read as
> int32_t since WASM is 32-bit) being used. Fix would be to add/change
> casts to (off_t) I think in various places in codebase.
>
> I'm travelling currently and unable to look further right now. If you
> want to go for it, I'd suggest committing to the remove_luajit branch
> to get AppVeyor build to run and perhaps get John or Victor to review
> as it's mostly in the mp3 code before merging to develop.
>
>
> ^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
> to 'lseek', should be i64
> ^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
> should be i64
> ^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
> to 'lseek', should be i64
> ^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
> should be i64
> ^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
> to 'lseek', should be i64
> ^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
> should be i64
> ^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
> to 'lseek', should be i64
> ^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
> should be i64
> ^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
> to 'lseek', should be i64
> ^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
> should be i64
> ^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
> to 'lseek', should be i64
> ^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
> should be i64
> ^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
> to 'lseek', should be i64
> ^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
> should be i64
> ^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
> to 'lseek', should be i64
> ^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
> should be i64
> ^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
> to 'lseek', should be i64
> ^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
> should be i64
> ^[[0;33mwarning:^[[0m unexpected return type void in call to
> 'csound_orc_scan_buffer', should be %struct.yy_buffer_state*
> ^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
> to 'lseek', should be i64
> ^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
> should be i64
> ^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
> to 'lseek', should be i64
> ^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
> should be i64
> ^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
> to 'lseek', should be i64
> ^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
> should be i64
> ^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
> to 'lseek', should be i64
> ^[[0;33mwarning:^[[0m unexpected return type i32 in call to 'lseek',
> should be i64
> ^[[0;33mwarning:^[[0m unexpected argument type i32 at index 1 in call
> to 'ftruncate', should be i64
> error: asm2wasm seeing an invalid argument type at index 1 (this will
> not validate) in call from $_mp3dec_init_file to $_lseek (this is
> likely d
> ue to undefined behavior in C, like defining a function one way and
> calling it in another, which is important to fix)
> error: asm2wasm seeing an invalid argument type at index 1 (this will
> not validate) in call from $_mp3dec_init_file to $_lseek (this is
> likely d
> ue to undefined behavior in C, like defining a function one way and
> calling it in another, which is important to fix)
> error: asm2wasm seeing an invalid argument type at index 1 (this will
> not validate) in call from $_mp3dec_init_file to $_lseek (this is
> likely d
> ue to undefined behavior in C, like defining a function one way and
> calling it in another, which is important to fix)
> error: asm2wasm seeing an invalid argument type at index 1 (this will
> not validate) in call from $_mp3dec_init_file to $_lseek (this is
> likely d
> ue to undefined behavior in C, like defining a function one way and
> calling it in another, which is important to fix)
> error: asm2wasm seeing an invalid argument type at index 1 (this will
> not validate) in call from $_mp3dec_init_file to $_lseek (this is
> likely d
> ue to undefined behavior in C, like defining a function one way and
> calling it in another, which is important to fix)
> error: asm2wasm seeing an invalid argument type at index 1 (this will
> not validate) in call from $_mp3dec_init_file to $_lseek (this is
> likely d
> ue to undefined behavior in C, like defining a function one way and
> calling it in another, which is important to fix)
> error: asm2wasm seeing an invalid argument type at index 1 (this will
> not validate) in call from $_mp3dec_seek to $_lseek (this is likely
> due to
> undefined behavior in C, like defining a function one way and calling
> it in another, which is important to fix)
> error: asm2wasm seeing an invalid argument type at index 1 (this will
> not validate) in call from $_mp3dec_seek to $_lseek (this is likely
> due to
> undefined behavior in C, like defining a function one way and calling
> it in another, which is important to fix)
> error: asm2wasm seeing an invalid argument type at index 1 (this will
> not validate) in call from $_mp3dec_seek to $_lseek (this is likely
> due to
> undefined behavior in C, like defining a function one way and calling
> it in another, which is important to fix)
> error: asm2wasm seeing an invalid argument type at index 1 (this will
> not validate) in call from $_psf_ftell to $_lseek (this is likely due
> to u
> ndefined behavior in C, like defining a function one way and calling
> it in another, which is important to fix)
> error: asm2wasm seeing an invalid argument type at index 1 (this will
> not validate) in call from $_psf_ftruncate to $_ftruncate (this is
> likely
> due to undefined behavior in C, like defining a function one way and
> calling it in another, which is important to fix)
> error: asm2wasm seeing an invalid argument type at index 1 (this will
> not validate) in call from $_psf_fseek to $_lseek (this is likely due
> to u
> ndefined behavior in C, like defining a function one way and calling
> it in another, which is important to fix)
> error: asm2wasm seeing an invalid argument type at index 1 (this will
> not validate) in call from $_psf_fseek to $_lseek (this is likely due
> to undefined behavior in C, like defining a function one way and
> calling it in another, which is important to fix)
>
> On Tue, May 28, 2019 at 5:31 PM Michael Gogins  wrote:
>>
>> I have pushed a remove_luajit branch of the csound develop branch that
>> removes the LuaJIT opcodes and their dependencies from the csound
>> repository. The Lua interface to Csound, and its dependency on the Lua
>> 5.1 library and headers, remain.
>>
>> I have rebuilt this branch for Ubuntu 18.04 and the native Android
>> libraries as well. I tried to build for WebAssembly but ran into what
>> appears to be a bug in the current build system for WebAssembly.
>>
>> I don't plan to merge the remove_luajit branch until the WebAssembly
>> build succeeds.
>>
>> Would you prefer that I fix up the WebAssembly build myself, or do you
>> want to try to build it in the remove_luajit branch?
>>
>> Regards,
>> Mike
>>
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com