Tiny Core Linux

Tiny Core Extensions => TCE Bugs => Topic started by: CNK on May 19, 2024, 01:35:03 AM

Title: MbedTLS Illegal Instruction on i586
Post by: CNK on May 19, 2024, 01:35:03 AM
I'm getting "illegal instruction" errors with MbedTLS libs on a Pentium 1 (i586), such as from the selftest program in mbedtls-bin:
Code: [Select]
$ /tmp/tcloop/mbedtls-bin/usr/local/bin/selftest
Illegal instruction

It seems from the build script (http://tinycorelinux.net/12.x/x86/tcz/src/mbedtls/mbedtls.build) that the x86 mbedtls-lib.tcz and mbedtls-bin.tcz extensions on TC12 and later were built with the x86_64 compiler flags instead of these x86 flags shown on the Wiki (http://wiki.tinycorelinux.net/doku.php?id=wiki:creating_extensions#installing):
Code: [Select]
export CFLAGS="-march=i486 -mtune=i686 -Os -pipe"
export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe"
export LDFLAGS="-Wl,-O1"

Since I built the updated Dillo extension for MbedTLS instead of OpenSSL, I expect this is why it's also failing with "Illegal instrucion" in TC15 on i586.
Title: Re: MbedTLS Illegal Instruction on i586
Post by: Juanito on May 19, 2024, 03:23:36 AM
Maybe you could pm the maintainer and request a replacement?
Title: Re: MbedTLS Illegal Instruction on i586
Post by: CNK on May 19, 2024, 03:59:15 AM
Thanks Juanito, yes PM sent.
Title: Re: MbedTLS Illegal Instruction on i586
Post by: CNK on January 23, 2025, 05:27:44 AM
I never got a response to my PM.

Mbed TLS 2 reached end of support with the end of 2024 according to the release notes (https://github.com/Mbed-TLS/mbedtls/releases). Should there be mbedtls3 extensions for version 3.6 (suported "until at least March 2027")? I think programs need to be recompiled to work with version 3.6.

I could submit mbedtls extensions built with the right compiler flags for x86 for the current Mbed TLS 3.6.2 release. I could also do the same for the x86_64 extension if its maintainer (polikuo) doesn't want to build v. 3.

Otherwise I'll go back to OpenSSL for building the new version of Dillo that's been released.
Title: Re: MbedTLS Illegal Instruction on i586
Post by: polikuo on January 24, 2025, 05:06:45 AM
I never got a response to my PM.

Mbed TLS 2 reached end of support with the end of 2024 according to the release notes (https://github.com/Mbed-TLS/mbedtls/releases). Should there be mbedtls3 extensions for version 3.6 (suported "until at least March 2027")? I think programs need to be recompiled to work with version 3.6.

I could submit mbedtls extensions built with the right compiler flags for x86 for the current Mbed TLS 3.6.2 release. I could also do the same for the x86_64 extension if its maintainer (polikuo) doesn't want to build v. 3.

Otherwise I'll go back to OpenSSL for building the new version of Dillo that's been released.

Hi, CNK.

Sorry for the late reply.

Feel free to take over if you already have a working build.

I'm mostly on raspberry pi now.
Title: Re: MbedTLS Illegal Instruction on i586
Post by: CNK on February 05, 2025, 08:49:18 PM
Updated MbedTLS extensions are now in the x86 and x86_64 TC15 repos as mbedtls3-lib.tcz, mbedtls3-bin.tcz, and mbedtls3-dev.tcz. All are built using the proper compiler flags. Any old extensions will need to be recompiled for MbedTLS v. 3 to use it (I've done this for Dillo).