~alpine/devel

1

is it possible to compile Alpine for 486?

Details
Message ID
<79f84b0c.6915.19ac43bb080.Coremail.yxj790222@163.com>
DKIM signature
missing
Download raw message
How can I modify -march parameter gracefully when I abuild command? Using abuild the default is -march=i586 -mtune=generic, is there a place to modify this parameter gracefully? and I have my best minimum kernel configure (best-mini.conf), how can I use my .conf file gracefully in abuild script?

6 	586/K5/5x86/6x86/6x86MX 	(-mtune=generic ; SIMD assembly modules enabled based on simple compile test and/or presence of CPU flag) 	1000 HZ 	Voluntary Kernel Preemption (Desktop) 	32 

does I need to compile i486-alpine-gcc crossing compile tools first?
Details
Message ID
<DEJGAQEW9WJE.29HYBUAEB67LC@posteo.net>
In-Reply-To
<79f84b0c.6915.19ac43bb080.Coremail.yxj790222@163.com> (view parent)
DKIM signature
missing
Download raw message
On Thu Nov 27, 2025 at 8:33 AM CET, 尤晓杰 wrote:
> How can I modify -march parameter gracefully when I abuild command? Using abuild the default is -march=i586 -mtune=generic, is there a place to modify this parameter gracefully? and I have my best minimum kernel configure (best-mini.conf), how can I use my .conf file gracefully in abuild script?
>
> 6 	586/K5/5x86/6x86/6x86MX 	(-mtune=generic ; SIMD assembly modules enabled based on simple compile test and/or presence of CPU flag) 	1000 HZ 	Voluntary Kernel Preemption (Desktop) 	32 
>
> does I need to compile i486-alpine-gcc crossing compile tools first?

I have never tried adding flags like -march without compiling a cross
compiler. There may be ways to make it work but I would not recommend it.

I would recommend to adapt _arch_configure in main/gcc/APKBUILD for your
target and then compile the cross compiler (with something like
scripts/bootstrap.sh <arch>).

You will likely encounter issues due to abuild missing (usable)
arch/triplet mappings for i486. The simplest (but a bit hacky) was is to
patch /usr/share/abuild/functions.sh. Ether by changing the "x86" arch to
be considered as i486 instead of i586:

--- a/functions.sh.in
+++ b/functions.sh.in
@@ -30 +30 @@ arch_to_triplet() {
-	x86)		echo "i586-alpine-linux-musl" ;;
+	x86)		echo "i486-alpine-linux-musl" ;;

Or by adding "i486" as new arch which may require changing more aports
to handle "i486" similar to "x86".

--- a/functions.sh.in
+++ b/functions.sh.in
@@ -29,2 +29,3 @@ arch_to_triplet() {
 	sh4)		echo "sh4-alpine-linux-musl" ;;
+	i486)		echo "i486-alpine-linux-musl" ;;
 	x86)		echo "i586-alpine-linux-musl" ;;
@@ -47,2 +48,3 @@ triplet_to_arch() {
 	armv7*-*-*-*eabihf)	echo "armv7" ;;
+	i486-*-*-*)		echo "i486" ;;
 	i[0-9]86-*-*-*)		echo "x86" ;;
Reply to thread Export thread (mbox)