PinePhone64

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
Dinosaur
Posts: 1427
Joined: Jul 24, 2005 1:13
Location: Hervey Bay
Contact:

PinePhone64

Post by Dinosaur »

Hi All

Received my latest toy with the long term aim of ditching the iPhone.

Of course the reason for posting here is to install Freebasic onto this phone to allow me to write a small application.
In particular; in Australia (and probably other countries) I can't go anywhere without scanning in a Qr code that tells
the health dept that I have visited that facility. They use this for tracking of Covid exposure.

The key is that the App is only available on iPhone or Android.
I can install Anbox (Android emulator) on this Linux phone but that sort of defeats the purpose.

The OS is Mobian which as the name suggests is Debian with mods for mobile phones.
So, I successfully installed Geany and all the libraries / dependencies for the ARM version of FreeBasic
including c compiler etc. as per readme in tar file.
Then when I tried to compile "Hello World" it failed.
I can't recall the message when I typed fbc hello.bas but it sounded like the program (fbc) could not run.
The processor is 64 bit:Quad-Core Allwinner A64 @ 1.152 GHz.

I downloaded the latest version linux-arm.
I have since updated to the latest version of Mobian (Bookworm, who thinks of these names ??) and will re-install everything
pending on advice or suggestions from you guys.

Is there something I have missed, or is it simply that the fb arm is only for a limited number of arm processors ?

Regards
speedfixer
Posts: 582
Joined: Nov 28, 2012 1:27
Location: California
Contact:

Re: PinePhone64

Post by speedfixer »

There are many who run FB on ARMs.
Anyone who wished to help will need complete error messages, of course.

There could a number of problems.

david
Dinosaur
Posts: 1427
Joined: Jul 24, 2005 1:13
Location: Hervey Bay
Contact:

Re: PinePhone64

Post by Dinosaur »

Hi All

Yes you are right, so re-installed and detailed the fault(s).
Readme says fbc copied to /usr/local , however fbc was put into /usr/local/bin

Trying to execute fbc got the following results.
Failed to execute child process x-terminal-emulator, no such file or directory
So installed gnome-terminal which fixed that problem.

Tried to execute fbc again
Failed to execute child proces, Failed to execute execve: no such file or directory
Can't get any hints as to which package provides that, but will browse.

Regards
caseih
Posts: 1969
Joined: Feb 26, 2007 5:32

Re: PinePhone64

Post by caseih »

That sort of error usually means the binary is incompatible with the OS. You could get that because the FB arm executable is 32-bit and the OS is 64-bit. What does the "file" command say about the fbc binary? Also you can use "ldd" to see what shared libraries the binary refers to, and whether they exist on your system.
Dinosaur
Posts: 1427
Joined: Jul 24, 2005 1:13
Location: Hervey Bay
Contact:

Re: PinePhone64

Post by Dinosaur »

Hi All

Thanks for the replies guys.

Running file fbc:
ELF 32 bit LSB executable
ARM EAB15 version 1 (sysv) dynamically linked,
Interpreter /lib/ld-linux-armhf.so.3
for GNU/Linux 3.2.0 not stripped.

Running ldd fbc:
not a dynamically executable.

Does that mean I should give up trying to run fbc on this device ?

Regards
Dinosaur
Posts: 1427
Joined: Jul 24, 2005 1:13
Location: Hervey Bay
Contact:

Re: PinePhone64

Post by Dinosaur »

Hi All

Perseverance always pays off.
Discovered using uname -m, that the correct description for the system is NOT ARM64
but aarch64.

So back into tests.
Freebasic release 1.09 has errors regarding GLIBC_2.34. that seem to explode into multiple other dependencies.
However release 1.07.2 works perfectly and I was able to compile and run Hello.bas.

One warning that I can't find any reference to is ..../fbextra.x contains output sections: Did you forget -T?

Will try to compile something GUI.

Regards
SARG
Posts: 1417
Joined: May 27, 2005 7:15
Location: FRANCE

Re: PinePhone64

Post by SARG »

Hi dinosaur,

There is a change in 1.09 for this warning due to glib version >2.35 :

fbextra.x needs to be:

Code: Select all

SECTIONS
{
  /DISCARD/ :
  {
    *(.fbctinf)
  }
}
INSERT AFTER .data;
And fbc.bas needs to be changed to add '-T' in front of fbextra.x

What is the version of glib on your system ?
Dinosaur
Posts: 1427
Joined: Jul 24, 2005 1:13
Location: Hervey Bay
Contact:

Re: PinePhone64

Post by Dinosaur »

Hi All

Thanks for the reply SARG
There is a change in 1.09 for this warning due to glib version >2.35 :
In the Pinephone it is 2.33-2

However are you assuming that I am building FBC ?
Have never done that and unless there are significant reasons to do so, I am content with using an earlier version.
As long as the warning doesn't impinge upon functionality.

Regards
caseih
Posts: 1969
Joined: Feb 26, 2007 5:32

Re: PinePhone64

Post by caseih »

If you have a working, albeit slightly older version of FBC, building the latest version is quite easy. Plus I think you'll be able to build a 64-bit version of FBC, even if your currently-running version of fbc is 32 bit.
SARG
Posts: 1417
Joined: May 27, 2005 7:15
Location: FRANCE

Re: PinePhone64

Post by SARG »

Dinosaur wrote:However are you assuming that I am building FBC ?
I'm assuming nothing just mostly answering to
Dinosaur wrote:One warning that I can't find any reference to
Is there a reason not using 1.09 ?
If not try it.

And maybe Glibc version causing this issue is before 2.35.
Dinosaur
Posts: 1427
Joined: Jul 24, 2005 1:13
Location: Hervey Bay
Contact:

Re: PinePhone64

Post by Dinosaur »

Hi All
Freebasic release 1.09 has errors regarding GLIBC_2.34. that seem to explode into multiple other dependencies.
The OS on the pinephone is Mobian "Bookworm" and browsing for the Glibc_2.34 shows it as experimental.

Also be aware that "EVERYTHING" on the pinephone is experimental.
However on FB 1.07.2 even the trusted old CGUI worked perfectly, so the question persists: Does the warning impinge on the funtionality of the compiled program ?

Regards
SARG
Posts: 1417
Joined: May 27, 2005 7:15
Location: FRANCE

Re: PinePhone64

Post by SARG »

Sorry Dinosaur, sometime my memory fails ;-)
It's a just a warning, you should not get any problem as I didn't get one when I reported the problem to Jeff.

You could, it's up to you, do a test without recompiling fbc :

- Compile a small example of code with -v -C , keep the object file (.o) and the log (all the executed commands)
- Change fbextra.x as in my previous post by adding "INSERT AFTER .data;" at the end of the file. Its location is visible in the log.
- Take the command line for the linker and add -T before the fbextra.x part.
- Execute only this line for linking.
Dinosaur
Posts: 1427
Joined: Jul 24, 2005 1:13
Location: Hervey Bay
Contact:

Re: PinePhone64

Post by Dinosaur »

Hi All

SARG, you are leading me into an area of unknowns.
Breaking it down into steps:
1 Compile with -v -C and save the .o and log
2:Change fbextra as noted
3:Change the Link command and add -T and link to produce the final executable.
(need to find out how to do that)

What is the expected result from this sequence,ie: No warning, so do this procedure every time I compile & Link ?

Like I said, I am in uncharted waters here, but will do to resolve it.
When does fbextra.x get used and does it get modified by any part of the process ?

Many thanks for your patience.

Regards
SARG
Posts: 1417
Joined: May 27, 2005 7:15
Location: FRANCE

Re: PinePhone64

Post by SARG »

The purpose is to verify that the changes are enough to remove the warning not for a normal compilation.

I know that your skills are far above this small operation ;-)

1 and 2 : easy

3 : in the compilation log extract just the line for the linking
Something like that

Code: Select all

ld -m elf_x86_64 -o "/home/laurent/Documents/fbdbgnew/fbdebugger_new" -dynamic-linker /lib64/ld-linux-x86-64.so.2 -T "/usr/local/bin/../lib/freebasic/linux-x86_64/fbextra.x" -L "/usr/local/bin/../lib/freebasic/linux-x86_64" -L "." -L "/usr/lib/gcc/x86_64-linux-gnu/8" "/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crt1.o" "/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crti.o" "/usr/lib/gcc/x86_64-linux-gnu/8/crtbegin.o" "/usr/local/bin/../lib/freebasic/linux-x86_64/fbrt0.o" "/home/laurent/Documents/fbdbgnew/fbdebugger_new.o" "-(" -lgtk-x11-2.0 -lgdk-x11-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lgmodule-2.0 -lcairo -lpango-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -latk-1.0 -lz -lGL -lGLU -lwindow9 -lX11 -lscintilla -lfbmt -ltinfo -lm -ldl -lpthread -lgcc -lgcc_eh -lc "-)" "/usr/lib/gcc/x86_64-linux-gnu/8/crtend.o" "/usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crtn.o" 
In this example of linking in front of "/usr/local/bin/../lib/freebasic/linux-x86_64/fbextra.x" there is -T, not in your case so add it.
Then put the complete line in a Bash script/file, save and execute it.

fbextra.x has been modified in 1.09 and -T is also added when compiling with 1.09.
After the test you will have to remove the extra line (INSERT....) otherwise you'll get a problem when normal compiling.

That me that have to thank you for your patience :-)
Dinosaur
Posts: 1427
Joined: Jul 24, 2005 1:13
Location: Hervey Bay
Contact:

Re: PinePhone64

Post by Dinosaur »

Hi All

Hi SARG
When you first detailed the steps, I put the -T in front of fbextra.x and of course it failed.
Something lost in translation French to English then English to a Dutch brain trying to operate in English.
Looking at your example, I realised you meant for me to append it to the ld statement.
Anyhow it all worked and I did not get the warning.

Because of the "Work In Progress" status of Mobian it is very difficult to do anything above simple.
IE: The settings screen is bigger then the phone screen , but you can't slide the screen side ways, so I rely on my hdmi connection to a large monitor.
However the phone keeps falling asleep frequently and thus loses it's connection to the monitor.
So, you have to start all over again.
We are getting daily updates so in time it will improve, but for the moment I will stick with version 7.02
Once al the "pain in the a**" features are resolved I will try to compile fbc to keep it up to date.

Many thanks for your help.

Regards
Post Reply