WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: RPI-64 export flags  (Read 6313 times)

Offline Mypresus

  • Newbie
  • *
  • Posts: 24
RPI-64 export flags
« on: December 12, 2021, 04:59:53 AM »
Hi there, can someone please let me know what the official export flags are for RPi-64.  I have found the x86-32, x86-64, and RPi-32 but no RPi-64 one. I have used the following in my script which work fine, but would like a confirmation on what should be use for RPI-64:
x86-32^ CFLAGS="-march=i486 -mtune=i686 -Os" CXXFLAGS="{$CFLAGS}" LDFLAGS="-wl,-01"
x86-64^ CFLAGS="-march=generic -Os" CXXFLAGS="{$CFLAGS}" LDFLAGS="-wl,-01"
RPi-32^ CFLAGS="-Os" CXXFLAGS="{$CFLAGS}" LDFLAGS="-wl,-01"
RPi-64^ CFLAGS="-march=aarch64 -mtune=generic -Os" CXXFLAGS="{$CFLAGS}" LDFLAGS="-wl,-01"
Any help would be appreciated, cheers Rob

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: RPI-64 export flags
« Reply #1 on: December 12, 2021, 05:14:44 AM »
piCore "-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe"

piCore64 "-march=armv8-a+crc -mtune=cortex-a72 -Os -pipe"

Edit: added "-pipe".
« Last Edit: December 12, 2021, 05:39:01 AM by Juanito »

Offline Mypresus

  • Newbie
  • *
  • Posts: 24
Re: RPI-64 export flags
« Reply #2 on: December 12, 2021, 05:30:57 AM »
Thank you Juanito for your quick reply.   Will use these  ;D and hope to be able to contribute to the TCE soon.

Cheers Rob

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: RPI-64 export flags
« Reply #3 on: December 12, 2021, 05:38:08 AM »
You can also try "-flto" and with cxx "-fno-exceptions" and "-fno-rtti" though one or more of these may fail.

In addition, removing "-g" and "-O2" from the Makefile(s) will reduce the size of the compiled binary/library.
« Last Edit: December 12, 2021, 05:46:33 AM by Juanito »

Offline Mypresus

  • Newbie
  • *
  • Posts: 24
Re: RPI-64 export flags
« Reply #4 on: December 12, 2021, 05:56:13 AM »
Thank you Juanito, as I'm scripting the complete process I'm looking for the lowest common denominator that will work, although smallest is good, successful compilation is paramount  ;D
just for some background this is what the config file  for the script currently looks like.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: RPI-64 export flags
« Reply #5 on: December 12, 2021, 06:06:49 AM »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: RPI-64 export flags
« Reply #6 on: December 12, 2021, 06:10:31 AM »
just for some background this is what the config file  for the script currently looks like.

Note that in tinycore all items not in the base should come under /usr/local, for example /usr/local/etc/extension_name/config.file

Offline Mypresus

  • Newbie
  • *
  • Posts: 24
Re: RPI-64 export flags
« Reply #7 on: December 12, 2021, 06:22:24 AM »
Thank you, this is some great info that will help in a better insight.  I started by wanting to install an extension that was not there so down the rabbit hole i went.  know I'm only a newbie to TC so I'm very grateful for all the info.

Offline Mypresus

  • Newbie
  • *
  • Posts: 24
Re: RPI-64 export flags
« Reply #8 on: December 12, 2021, 06:39:51 AM »
Hi Juanito, all the files in the example .cfg come under the  /tmp/tcloop/user/local.
This brings me to another question as in the example haproxy looks for a .cfg file under /etc/haproxy. My solution was the write a script in tce.installed that will create a haproxy file and symlink to where haproxy was looking and direct it to permanent storage /etc/sysconfig/tcedir/.config/haproxy/haproxy.cfg   Is this the way it should be done as this is the only permanent storage available without doing backup.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: RPI-64 export flags
« Reply #9 on: December 12, 2021, 06:48:25 AM »
Many apps will allow you to set --sysconfdir=/usr/local/etc

In addition, many apps allow for a user specific config under ~/.config, which tinycore will backup by default if a backup is enabled.


Offline Mypresus

  • Newbie
  • *
  • Posts: 24
Re: RPI-64 export flags
« Reply #10 on: December 12, 2021, 07:02:57 AM »
As haproxy is a run as a server/daemon so when logged out would ~/.config no longer be available (sorry have a Win background) so not sure?  I found TC be to great at providing a clean slate on boot this is one of the reasons of being a fan of TC, so don't run backup and have sd/usb for permanent storage.  Hence the permanent storage for .cfg I maybe thinking this all wrong so apologies in advance .  Cheers Rob

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: RPI-64 export flags
« Reply #11 on: December 12, 2021, 07:25:15 AM »
I can’t comment on the specific case of haproxy, but files under ~/.config will only be lost on reboot without a backup.

You can also make a customised local extension that contains whatever config you wish.

Offline Mypresus

  • Newbie
  • *
  • Posts: 24
Re: RPI-64 export flags
« Reply #12 on: December 12, 2021, 08:07:41 AM »
Hi  Juanito i'm here to learn on how the whole concept works, and I understand each program/extension user/organisation has its own requirements. so not here to judge or complain just working out the logic.  My understanding so far is if a program/extension is truly user based then ~/.config is used for .cfg and must use backup, other wise .cfg is lost.  In the case of programs specifically looking for a .cfg file through configuration by command line or other means etc. we can create a symlink of where the program is expecting the find the .cfg and create the actual file in ~/.config or on permanent storage somewhere.  If there can be a standard file designation created for this situation for permanent storage that would be great as this will assist in creating scripts on the fly etc...  such as in tce.installed script.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704
Re: RPI-64 export flags
« Reply #13 on: December 12, 2021, 11:57:41 AM »
Hi Mypresus
Attached is the script I used for the most recent package I submitted. It's fairly well commented but I'll point out
some of the things I'm doing anyway. The script handles compiling and creating all of the package files. If you
open the script using the following command you can view it with line numbers to follow along:
Code: [Select]
less -N CompileResizerYou can navigate with the PageUp, PageDown, up arrow, and down arrow keys.

-------------------------------------------------------------------------------------------------------
Line:
__3  I alias to busybox commands when possible since they are always present and because the GNU counterparts
     sometimes behave differently. I  also set options to the commands there.
_28  Sets the compiler flags to match the processor you are currently running on.
_65 to _79  I don't use make files for stuff I write so the compile and link commands go here. The size and
     ls commands give me an indication of how big my program is getting as I develop it.
     You would replace this with:
          export CFLAGS CXXFLAGS LDFLAGS PREFIX DESTDIR     plus any other variables you need to export.
          ./configure --prefix=$PREFIX
          make
          make install
_81  Uncomment this line to exit the script early if you are getting build errors. Re-comment it once the
     errors have been resolved and rerun the script.
_94  The build results are archived in a separate subdirectory for each processor type. This way you can
     use a removable drive to build on different architectures while retaining a backup of the other builds.
117  This is where the  .info  file is created. Most of the variable fields get updated automatically. The
     Change-log:  field (line 188) needs to be updated manually when new versions are created.
-------------------------------------------------------------------------------------------------------


You can download the the Resizer tarball (8 KBytes) from here if you want to run the script and see the results:
http://tinycorelinux.net/12.x/x86/tcz/src/Resizer/

I've also attached an older less refined script that builds the gpicview image viewer. That package does use
./configure  and  make.  It also makes other fixes for Tinycore compatibility, such as  .desktop  files and  icons.
It also sets some variables such as PREFIX and DESTDIR so you may want to take a peek at that.
You should be able to run this script directly since it downloads the source code itself. Place the script in its
own subdirectory if you want to do this.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: RPI-64 export flags
« Reply #14 on: December 12, 2021, 12:53:55 PM »
If there can be a standard file designation created for this situation for permanent storage that would be great as this will assist in creating scripts on the fly etc...  such as in tce.installed script.

There’s a provision in tinycore for /home and/opt on permanent storage, but not files in other locations.

You could save files to the tce folder, but users might not want them there.

If you don’t wish to use a backup, you could load extensions with a simple script that copied the required config file from permanent storage.