From eacc692ef971807f490a91b1f2266199eddb6262 Mon Sep 17 00:00:00 2001 From: Karl-Michael Schindler Date: Wed, 6 May 2026 10:26:30 +0200 Subject: [PATCH] fpc-cross-arm-*: add new subports - add a series of cross compilers for arm systems including the corresponding binutils. - include and update arm-elf binutils - fixing a file conflict with avr cross compilers --- cross/arm-binutils/Portfile | 180 ++++++++++++++++++++++++++++++++ cross/arm-elf-binutils/Portfile | 11 -- lang/fpc/Portfile | 92 +++++++++++++++- 3 files changed, 271 insertions(+), 12 deletions(-) create mode 100644 cross/arm-binutils/Portfile delete mode 100644 cross/arm-elf-binutils/Portfile diff --git a/cross/arm-binutils/Portfile b/cross/arm-binutils/Portfile new file mode 100644 index 00000000000..a87726b89ab --- /dev/null +++ b/cross/arm-binutils/Portfile @@ -0,0 +1,180 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 + +PortSystem 1.0 +PortGroup crossbinutils 1.0 + +name arm-binutils +version 2.46.0 +revision 0 +maintainers {@kamischi web.de:karl-michael.schindler} \ + openmaintainer + +if {$subport eq $name} { + # Download sources and install docs for all subports + crossbinutils.setup arm ${version} + depends_build + depends_lib + platforms any + supported_archs noarch + use_configure no + build {} + destroot {} +} + +foreach ostarget {elf freebsd} { + subport arm-${ostarget}-binutils { + crossbinutils.setup arm-${ostarget} ${version} + # Depend on base package for installing the docs + depends_lib-append port:$name + configure.args-append --disable-werror + # Delete docs since already installed by the base package + # Resolves clash about identical docs from each subport + post-destroot { + delete ${destroot}${prefix}/share/doc/arm-binutils + } + } +} + +subport arm-linux-androideabi-binutils { + crossbinutils.setup arm-linux-androideabi ${version} + depends_lib-append port:$name + configure.args-append \ + --target=armv7a-linux-androideabi \ + --disable-werror + + post-destroot { + # See comment above about deleting docs + delete ${destroot}${prefix}/share/doc/arm-binutils + file rename ${destroot}${prefix}/armv7a-linux-androideabi/bin \ + ${destroot}${prefix}/arm-linux-androideabi + file rename ${destroot}${prefix}/armv7a-linux-androideabi/lib \ + ${destroot}${prefix}/arm-linux-androideabi + file delete ${destroot}${prefix}/armv7a-linux-androideabi + } +} + +subport arm-embedded-binutils { + crossbinutils.setup arm-embedded ${version} + depends_lib-append port:$name + configure.args-append \ + --target=arm-unknown-elf \ + --disable-werror + + post-destroot { + # See comment above about deleting docs + delete ${destroot}${prefix}/share/doc/arm-binutils + file rename ${destroot}${prefix}/arm-unknown-elf/bin \ + ${destroot}${prefix}/arm-embedded + file rename ${destroot}${prefix}/arm-unknown-elf/lib \ + ${destroot}${prefix}/arm-embedded + file delete ${destroot}${prefix}/arm-unknown-elf + } +} + +subport arm-freertos-binutils { + crossbinutils.setup arm-freertos ${version} + depends_lib-append port:$name + configure.args-append \ + --target=arm-stellaris-eabi \ + --disable-werror + + post-destroot { + # See comment above about deleting docs + delete ${destroot}${prefix}/share/doc/arm-binutils + file rename ${destroot}${prefix}/arm-stellaris-eabi/bin \ + ${destroot}${prefix}/arm-freertos + file rename ${destroot}${prefix}/arm-stellaris-eabi/lib \ + ${destroot}${prefix}/arm-freertos + file delete ${destroot}${prefix}/arm-stellaris-eabi + } +} + +subport arm-gba-binutils { + crossbinutils.setup arm-gba ${version} + depends_lib-append port:$name + configure.args-append \ + --target=arm-thumb-elf \ + --disable-werror + + post-destroot { + # See comment above about deleting docs + delete ${destroot}${prefix}/share/doc/arm-binutils + file rename ${destroot}${prefix}/arm-thumb-elf/bin \ + ${destroot}${prefix}/arm-gba + file rename ${destroot}${prefix}/arm-thumb-elf/lib \ + ${destroot}${prefix}/arm-gba + file delete ${destroot}${prefix}/arm-thumb-elf + } +} + +subport arm-linux-binutils { + crossbinutils.setup arm-linux ${version} + depends_lib-append port:$name + configure.args-append \ + --target=arm-linux-gnueabi \ + --disable-werror + + post-destroot { + # See comment above about deleting docs + delete ${destroot}${prefix}/share/doc/arm-binutils + file rename ${destroot}${prefix}/arm-linux-gnueabi/bin \ + ${destroot}${prefix}/arm-linux + file rename ${destroot}${prefix}/arm-linux-gnueabi/lib \ + ${destroot}${prefix}/arm-linux + file delete ${destroot}${prefix}/arm-linux-gnueabi + } +} + +subport arm-nds-binutils { + crossbinutils.setup arm-nds ${version} + depends_lib-append port:$name + configure.args-append \ + --target=arm-thumb-elf \ + --disable-werror + + post-destroot { + # See comment above about deleting docs + delete ${destroot}${prefix}/share/doc/arm-binutils + file rename ${destroot}${prefix}/arm-thumb-elf/bin \ + ${destroot}${prefix}/arm-nds + file rename ${destroot}${prefix}/arm-thumb-elf/lib \ + ${destroot}${prefix}/arm-nds + file delete ${destroot}${prefix}/arm-thumb-elf + } +} + +subport arm-netbsd-binutils { + crossbinutils.setup arm-netbsd ${version} + depends_lib-append port:$name + configure.args-append \ + --target=arm-netbsdelf-gnu \ + --disable-werror + + post-destroot { + # See comment above about deleting docs + delete ${destroot}${prefix}/share/doc/arm-binutils + file rename ${destroot}${prefix}/arm-netbsdelf-gnu/bin \ + ${destroot}${prefix}/arm-netbsd + file rename ${destroot}${prefix}/arm-netbsdelf-gnu/lib \ + ${destroot}${prefix}/arm-netbsd + file delete ${destroot}${prefix}/arm-netbsdelf-gnu + } +} + +subport arm-wince-binutils { + crossbinutils.setup arm-wince ${version} + depends_lib-append port:$name + configure.args-append \ + --target=arm-wince-pe \ + --disable-werror + + post-destroot { + # See comment above about deleting docs + delete ${destroot}${prefix}/share/doc/arm-binutils + file rename ${destroot}${prefix}/arm-wince-pe/bin \ + ${destroot}${prefix}/arm-wince + file rename ${destroot}${prefix}/arm-wince-pe/lib \ + ${destroot}${prefix}/arm-wince + file delete ${destroot}${prefix}/arm-wince-pe + } +} diff --git a/cross/arm-elf-binutils/Portfile b/cross/arm-elf-binutils/Portfile deleted file mode 100644 index a4a99023434..00000000000 --- a/cross/arm-elf-binutils/Portfile +++ /dev/null @@ -1,11 +0,0 @@ -# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 - -PortSystem 1.0 -PortGroup crossbinutils 1.0 - -crossbinutils.setup arm-elf 2.34 -maintainers nomaintainer -revision 1 - -# Fix build problems on powerpc, #29925 -configure.args-append --disable-werror diff --git a/lang/fpc/Portfile b/lang/fpc/Portfile index 638f06b286c..5cbd51da848 100644 --- a/lang/fpc/Portfile +++ b/lang/fpc/Portfile @@ -235,6 +235,91 @@ subport "${name}-cross-arm-wince" { } } +foreach ostarget {linux android gba nds} { + subport "${name}-cross-arm-$ostarget" { + revision 0 + categories-append cross + worksrcdir fpcbuild-${version}/fpcsrc + use_parallel_build no + use_configure no + depends_build-append port:${name} port:${name}-cross + if {$ostarget eq "android"} { + depends_build-append port:arm-linux-androideabi-binutils + } else { + depends_build-append port:arm-${ostarget}-binutils + } + build.target rtl packages + destroot.target rtl_install packages_install + test.target + +# target specifics + description FPC cross-compiler for arm-$ostarget + long_description \ + This Pascal crosscompiler produces arm executables, \ + which run natively on arm-$ostarget systems. \n \ + Get help with: \n \ + fpc -h \n \ + Compile and link a Pascal file with: \n \ + \n \ + fpc -Parm -T$ostarget FILENAME + + build.args PP=ppcarm CPU_TARGET=arm OS_TARGET=$ostarget \ + OPT="-ap -v0" + destroot.args CPU_TARGET=arm OS_TARGET=$ostarget CROSSINSTALL=1 \ + INSTALL_PREFIX=${destroot}${prefix}/libexec/fpc + +# remove duplicate doc and bin files + post-destroot { + file delete -force ${destroot}${prefix}/libexec/fpc/share + file delete -force ${destroot}${prefix}/libexec/fpc/bin + } + } +} + +foreach subarch {armv4 armv4t armv6m armv7a armv7em armv7m} { + subport "${name}-cross-${subarch}-embedded" { + revision 0 + categories-append cross + supported_archs noarch + worksrcdir fpcbuild-${version}/fpcsrc + use_parallel_build no + use_configure no + depends_build-append port:${name} port:${name}-cross port:arm-embedded-binutils + build.target rtl packages + destroot.target rtl_install packages_install + test.target + + # target specifics + description FPC cross-compiler for ${subarch}-embedded + long_description \ + This Pascal crosscompiler produces arm executables, \ + which run natively on arm-embedded systems. \n \ + Get help with: \n \ + fpc -h \n \ + Compile and link a Pascal file with: \n \ + \n \ + fpc -Parm -Tembedded -Cp${subarch} FILENAME + + build.args PP=ppcarm CPU_TARGET=arm OS_TARGET=embedded \ + OPT="-ap -v0" SUBARCH=${subarch} + destroot.args CPU_TARGET=arm OS_TARGET=embedded CROSSINSTALL=1 \ + INSTALL_PREFIX=${destroot}${prefix}/libexec/fpc \ + SUBARCH=${subarch} \ + INSTALL_UNITDIR=/${destroot}${prefix}/libexec/fpc/lib/fpc/${version}/units/arm-embedded/${subarch} + + # Capture loop variable immediately into a port-local variable for + # deferred use in destroot phase + set my_subarch ${subarch} + # remove duplicate doc and bin files + post-destroot { + file delete -force ${destroot}${prefix}/libexec/fpc/share + file delete -force ${destroot}${prefix}/libexec/fpc/bin + set fpmkinstPath ${destroot}${prefix}/libexec/fpc/lib/fpc/${version}/fpmkinst + file rename ${fpmkinstPath}/arm-embedded ${fpmkinstPath}/${my_subarch}-embedded + } + } +} + foreach ostarget {nativent win32 wince} { subport "${name}-cross-i386-$ostarget" { revision 3 @@ -429,7 +514,7 @@ foreach ostarget {linux netbsd embedded} { foreach subarch {avr25 avr35 avr4 avr5 avr51 avr6} { subport "${name}-cross-${subarch}-embedded" { - revision 0 + revision 1 categories-append cross supported_archs noarch worksrcdir fpcbuild-${version}/fpcsrc @@ -458,10 +543,15 @@ foreach subarch {avr25 avr35 avr4 avr5 avr51 avr6} { SUBARCH=${subarch} \ INSTALL_UNITDIR=/${destroot}${prefix}/libexec/fpc/lib/fpc/${version}/units/avr-embedded/${subarch} + # Capture loop variable immediately into a port-local variable for + # deferred use in destroot phase + set my_subarch ${subarch} # remove duplicate doc and bin files post-destroot { file delete -force ${destroot}${prefix}/libexec/fpc/share file delete -force ${destroot}${prefix}/libexec/fpc/bin + set fpmkinstPath ${destroot}${prefix}/libexec/fpc/lib/fpc/${version}/fpmkinst + file rename ${fpmkinstPath}/avr-embedded ${fpmkinstPath}/${my_subarch}-embedded } } }