Skip to content

Enable build on ppc64le systems #8782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!--echo message="os.name = ${os.name}" /-->
<!--echo message="os.arch = ${os.arch}" /-->
<!--echo message="os.version = ${os.version}" /-->
<echo message="os.arch = ${os.arch}"/>

<tstamp>
<format property="BUILD_DATE" pattern="yyyy/MM/dd hh:mm"/>
Expand All @@ -24,6 +25,7 @@
<condition property="platform" value="linux64"><os family="unix" arch="amd64" /></condition>
<condition property="platform" value="linuxarm"><os family="unix" arch="arm" /></condition>
<condition property="platform" value="linuxaarch64"><os family="unix" arch="aarch64" /></condition>
<condition property="platform" value="linuxppc64le"><os family="unix" arch="ppc64le" /></condition>

<condition property="windows_host" value="true"><os family="windows" /></condition>

Expand All @@ -35,20 +37,23 @@
<condition property="linux"><equals arg1="${platform}" arg2="linux64" /></condition>
<condition property="linux"><equals arg1="${platform}" arg2="linuxarm" /></condition>
<condition property="linux"><equals arg1="${platform}" arg2="linuxaarch64" /></condition>
<condition property="linux"><equals arg1="${platform}" arg2="linuxppc64le" /></condition>

<condition property="staging_folder" value="macosx"><equals arg1="${platform}" arg2="macosx" /></condition>
<condition property="staging_folder" value="windows"><equals arg1="${platform}" arg2="windows" /></condition>
<condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linux32" /></condition>
<condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linux64" /></condition>
<condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linuxarm" /></condition>
<condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linuxaarch64" /></condition>
<condition property="staging_folder" value="linux"><equals arg1="${platform}" arg2="linuxppc64le" /></condition>

<condition property="staging_hardware_folder" value="Arduino.app/Contents/Java/hardware"><equals arg1="${platform}" arg2="macosx" /></condition>
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="windows" /></condition>
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux32" /></condition>
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linux64" /></condition>
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linuxarm" /></condition>
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linuxaarch64" /></condition>
<condition property="staging_hardware_folder" value="hardware"><equals arg1="${platform}" arg2="linuxppc64le" /></condition>

<condition property="arch-bits" value="32">
<equals arg1="${platform}" arg2="linux32"/>
Expand All @@ -62,6 +67,9 @@
<condition property="arch-bits" value="64">
<equals arg1="${platform}" arg2="linuxaarch64"/>
</condition>
<condition property="arch-bits" value="64">
<equals arg1="${platform}" arg2="linuxppc64le"/>
</condition>

<condition property="launch4j-download-unpack-target-name" value="launch4j-windows"><os family="windows" /></condition>
<property name="launch4j-download-unpack-target-name" value="launch4j-linux"/>
Expand All @@ -72,12 +80,14 @@
<property name="LINUX64_BUNDLED_JVM" value="none"/>
<property name="LINUXARM_BUNDLED_JVM" value="none"/>
<property name="LINUXAARCH64_BUNDLED_JVM" value="none"/>
<property name="LINUXPOWERPC64LE_BUNDLED_JVM" value="none"/>
<condition property="linux-bundle-jvm-task" value="noop">
<and>
<equals arg1="${LINUX32_BUNDLED_JVM}" arg2="none"/>
<equals arg1="${LINUX64_BUNDLED_JVM}" arg2="none"/>
<equals arg1="${LINUXARM_BUNDLED_JVM}" arg2="none"/>
<equals arg1="${LINUXAARCH64_BUNDLED_JVM}" arg2="none"/>
<equals arg1="${LINUXPOWERPC64LE_BUNDLED_JVM}" arg2="none"/>
</and>
</condition>
<condition property="linux-bundle-jvm-task" value="bundle">
Expand All @@ -94,6 +104,9 @@
<not>
<equals arg1="${LINUXAARCH64_BUNDLED_JVM}" arg2="none"/>
</not>
<not>
<equals arg1="${LINUXPOWERPC64LE_BUNDLED_JVM}" arg2="none"/>
</not>
</or>
</condition>

Expand Down Expand Up @@ -763,6 +776,48 @@
</antcall>
</target>

<target name="linux-libastyle-ppc64le" depends="linux-build" description="Download libastyle.so for PowerPC64LE">
<antcall target="unzip">
<param name="archive_file" value="./libastylej-2.05.1-4.zip" />
<param name="archive_url" value="https://downloads.arduino.cc/libastylej-2.05.1-4.zip" />
<param name="final_folder" value="${staging_folder}/libastylej-2.05.1" />
<param name="dest_folder" value="${staging_folder}" />
</antcall>
<copy file="linux/libastylej-2.05.1/libastylej_ppc64le.so" tofile="linux/work/lib/libastylej.so" />
<chmod perm="755" file="linux/work/lib/libastylej.so" />

<antcall target="portable-${portable}">
<param name="parentdir" value="linux/work" />
</antcall>

<antcall target="unzip">
<param name="archive_file" value="./liblistSerials-${LIBLISTSERIAL-VERSION}.zip" />
<param name="archive_url" value="https://downloads.arduino.cc/liblistSerials/liblistSerials-${LIBLISTSERIAL-VERSION}.zip" />
<param name="final_folder" value="${staging_folder}/liblistSerials-${LIBLISTSERIAL-VERSION}" />
<param name="dest_folder" value="${staging_folder}" />
</antcall>
<copy file="linux/liblistSerials-${LIBLISTSERIAL-VERSION}/ppc64le/liblistSerialsj.so" todir="linux/work/lib/" />
<chmod perm="755" file="linux/work/lib/liblistSerialsj.so" />
</target>

<target name="linuxppc64le-build" depends="linux-libastyle-ppc64le" description="Build Linux (PowerPC64LE) version">
<antcall target="linux-jvm-${linux-bundle-jvm-task}">
<param name="JVM" value="${LINUXPOWERPC64LE_BUNDLED_JVM}"/>
</antcall>

<antcall target="build-arduino-builder" />

<antcall target="avr-toolchain-bundle">
<param name="unpack_target" value="untar"/>
<param name="gcc_archive_file" value="avr-gcc-${AVRGCC-VERSION}-powerpc64le-pc-linux-gnu.tar.bz2"/>
<param name="gcc_version" value="${AVRGCC-VERSION}"/>
<param name="avrdude_archive_file" value="avrdude-${AVRDUDE-VERSION}-powerpc64le-pc-linux-gnu.tar.bz2"/>
<param name="avrdude_version" value="${AVRDUDE-VERSION}"/>
<param name="arduinoOTA_archive_file" value="arduinoOTA-${arduinoOTA-VERSION}-linux_ppc64le.tar.bz2"/>
<param name="arduinoOTA_version" value="${arduinoOTA-VERSION}"/>
</antcall>
</target>

<target name="linux32-build" depends="linux-libastyle-x86" description="Build linux (32-bit) version">
<antcall target="linux-jvm-${linux-bundle-jvm-task}">
<param name="JVM" value="${LINUX32_BUNDLED_JVM}"/>
Expand Down Expand Up @@ -819,6 +874,8 @@

<target name="linuxaarch64-run" depends="build,start"/>

<target name="linuxppc64le-run" depends="build,start"/>

<target name="linux32-start">
<exec executable="./linux/work/arduino" spawn="false" failonerror="true"/>
</target>
Expand All @@ -835,6 +892,10 @@
<exec executable="./linux/work/arduino" spawn="false" failonerror="true"/>
</target>

<target name="linuxppc64le-start">
<exec executable="./linux/work/arduino" spawn="false" failonerror="true"/>
</target>

<target name="build-arduino-builder" unless="no_arduino_builder">
<delete dir="${staging_folder}/arduino-builder-${platform}" includeemptydirs="true"/>
<mkdir dir="${staging_folder}/arduino-builder-${platform}"/>
Expand Down Expand Up @@ -969,6 +1030,9 @@
<target name="linuxaarch64-dist" depends="linux-dist"
description="Build .tar.xz of linux aarch64 version" />

<target name="linuxppc64le-dist" depends="linux-dist"
description="Build .tar.xz of linux ppc64le version" />

<!-- - - - - - - - -->
<!-- Windows -->
<!-- - - - - - - - -->
Expand Down