Skip to content

AmigaOS : curl_setup avoid explicit_bzero with clib2#21989

Closed
boingball wants to merge 1 commit into
curl:masterfrom
boingball:fix-clib2-explicit-bzero-clean
Closed

AmigaOS : curl_setup avoid explicit_bzero with clib2#21989
boingball wants to merge 1 commit into
curl:masterfrom
boingball:fix-clib2-explicit-bzero-clean

Conversation

@boingball

@boingball boingball commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

clib2 defines NEWLIB after its system headers are included, but it does not provide explicit_bzero().

curl therefore selects the explicit_bzero() path and fails to build with m68k-amigaos-gcc:

In file included from curlx/strdup.c:24:
curlx/strdup.c: In function 'curlx_freezero':
../lib/curl_setup.h:1650:35: error: implicit declaration of function 'explicit_bzero' [-Werror=implicit-function-declaration]
 1650 | #define curlx_memzero(buf, size)  explicit_bzero(buf, size)
      |                                   ^~~~~~~~~~~~~~
curlx/strdup.c:115:5: note: in expansion of macro 'curlx_memzero'
  115 |     curlx_memzero(buf, size);
      |     ^~~~~~~~~~~~~

Excluding CLIB2 from the generic NEWLIB branch makes curl use its existing portable curlx_memzero() fallback.
The full AmigaOS build then completes successfully.

I've tested the following on Amiga OS 3.2.3 with this patch and latest build.

  • HTTP and HTTPS transfers
  • AmiSSL certificate handling
  • redirects
  • downloads and file output
  • timeout handling with the expected exit code 28
  • repeated execution with clean exits
  • no crashes or regressions observed

Follow-up to 066478f #21598

@vszakats vszakats closed this in 982e2e8 Jun 12, 2026
@vszakats

Copy link
Copy Markdown
Member

Thanks!

It still hurts we were forced to drop the Amiga jobs from CI,
because the toolchain disappearing from the interwebs. I
wish I made a copy (or found one somewhere).

@boingball

Copy link
Copy Markdown
Contributor Author

Thanks!

It still hurts we were forced to drop the Amiga jobs from CI, because the toolchain disappearing from the interwebs. I wish I made a copy (or found one somewhere).

Bebbo moved the Amiga GCC Toolchain off github over to cordberg - https://codeberg.org/bebbo/amiga-gcc
and GCC v16 has been added to it.

There is also a fork of the prior git hub - before removal here - https://github.com/AmigaPorts/m68k-amigaos-gcc
Hopefully maybe these might help.

@vszakats

vszakats commented Jun 12, 2026

Copy link
Copy Markdown
Member

Is there perhaps a place where the pre-built Linux binary package is available?
It went by this URL:
https://github.com/bebbo/amiga-gcc/releases/download/Mechen/amiga-gcc.tgz

(using the Windows toolchain would be an alternative in theory, but last
time I tried locally I failed miserably to make it work. I'd also expect perf
to be (much) lower than Linux. I had no luck with accessing this link just
now: http://franke.ms/download/setup-amiga-gcc.exe)

@boingball

Copy link
Copy Markdown
Contributor Author

Is there perhaps a place where the pre-built Linux binary package is available? It went by this URL: https://github.com/bebbo/amiga-gcc/releases/download/Mechen/amiga-gcc.tgz

(using the Windows toolchain would be an alternative in theory, but last time I tried locally I failed miserably to make it work. I'd also expect perf to be (much) lower than Linux. I had no luck with accessing this link just now: http://franke.ms/download/setup-amiga-gcc.exe)

I've had a look around and it seems that bebbo is also hosting that pre-built file here
https://franke.ms/download/amiga-gcc.tgz

it seems to be GCC 6.5.0 - which maybe your CI was working off before.

If that's not helpful I can send a message to Bebbo to see if I can host the pre-built based off the newer GCC.

@vszakats

Copy link
Copy Markdown
Member

Lovely, I see if I can fire up the CI job again. And possibly add caching to
not hammer Bebbo's server.

GCC 6.5.0 is fine, the job doubling as tests for an older GCC version is useful.
Though can be upgraded in a future step if it's useful for the platform, and
we have binaries.

@vszakats

Copy link
Copy Markdown
Member

AmigaOS is in CI again, yay!: #21993

@boingball

Copy link
Copy Markdown
Contributor Author

Excellent work @vszakats ! - glad I could help.

vszakats added a commit that referenced this pull request Jun 12, 2026
Fix build issues:
- src: adjust `toolx_ftruncate()`.
- libtests/cli_ftp_upload: make `struct timeval` initialization portable.
- libtests/lib1960: do unconst in local `inet_pton()` macro.
- tests/server/dnsd: make it stub instead of failing the build.
- tests/server: make them link AmiSSL for `SocketBase`.

Also:
- bump AmiSSL to the latest release.
- add download hash checks and toolchain cache.
- sync restored code with local updates made since last year.

It takes 30 seconds per job, 1 minute in total.

Thanks-to: Bebbo
Thanks-to: Darren Banfi
Ref: #21989 (comment)
Follow-up to 7a14898 #17486

Closes #21993
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants