View Issue Details

IDProjectCategoryView StatusLast Update
0036316LazarusIDEpublic2020-04-06 21:21
ReporterAlfred Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformHaiku x86_64 
Summary0036316: Makefile does not support Haiku x86_64
DescriptionPlease add Haiku x86_64 as a target for Lazarus into the Makefiles of Lazarus trunk (and fixes/stable ?).
TagsNo tags attached.
Fixed in Revisionr62890
LazTarget-
WidgetsetQT5
Attached Files

Activities

Alfred

2019-11-15 13:48

reporter  

FPCHaiku.JPG (124,569 bytes)   
FPCHaiku.JPG (124,569 bytes)   

Juha Manninen

2020-04-03 14:57

developer   ~0121864

I don't believe any Lazarus core developer actively uses or even tests Haiku. You really should provide a patch if you want this change to happen.
I will apply it unless it breaks compilation for other platforms.

Alfred

2020-04-04 08:06

reporter   ~0121883

The first thing that is needed to be able to test this platform, is to add this target into the makefiles.
That will break nothing.

When this target is enabled, me and others can start testing and send patches if needed.
So, the only request at this moment is to add/enable the target.
Beautiful things will/might happen when enabled ... ;-)

Juha Manninen

2020-04-04 09:53

developer   ~0121885

> The first thing that is needed to be able to test this platform, is to add this target into the makefiles.

Then please add this target into the makefiles. What is the problem?

Alfred

2020-04-04 10:08

reporter   ~0121886

Two things.
1:
Please tell me how to update all makefiles with a new target. I could not find any info on how to do this in the most efficient way. Or point me towards available info on how to do this. Help will be appreciated.
2:
If you add this target into Lazarus trunk, it will be available not only to me, but also to others that are interested (through private mails, I got some requests to have fpcupdeluxe install Lazarus on Haiku x64).

Juha Manninen

2020-04-04 13:45

developer   ~0121892

1. Good point. I guess it is part of fpcmake's documentation provided by FPC project. I have never updated the Makefiles myself. Mattias is the only person who knows the build system well.
I planned to update them as part of the IdeIntf package split. Then I got technical problems (long story, not relevant here) and Mattias had to commit my changes + update Makefiles.
I believe you know the build system better than I due to your fpcupdeluxe maintenance.
Anyway: below are instructions sent by Mattias. Mailing list may be the best place to ask further questions about building.
"
Makefiles are created from the Makefile.fpc via fpcmake of trunk fpc:
cd your/lazarus
export FPCDIR=/your/fpc_sources/3.3.1/fpc/
PATH=/your/fpc_sources/3.3.1/fpc/utils/fpcm/bin/x86_64-linux/:$PATH ./tools/updatemakefiles
export FPCDIR=
"

2. I need a patch. I don't have time or energy to study the build system further right now. There are other issues I am working on.
I would be happy if you studied this Makefile issue. It is bad that only one person (Mattias) knows it well.

Alfred

2020-04-04 21:27

reporter   ~0121907

@juha.
Well, I did give it a try. Did not succeed. Looked into the sources. Found this:
writeln('Updates for every lpk in the lazarus directory the Makefile.fpc, Makefile.compiled and Makefile.');
As you can guess, all other Makefiles, including the important once (for building Lazarus itself), remained untouched and unchanged.
I am in need of some more directions.

Anton Kavalenka

2020-04-04 22:24

reporter   ~0121908

Lazarus trunk Makefile has x86_64-haiku target

Alfred

2020-04-05 06:19

reporter   ~0121916

@Anton.
See screenshot.
haikux64.JPG (180,306 bytes)   
haikux64.JPG (180,306 bytes)   

Alfred

2020-04-05 07:31

reporter   ~0121919

Got you ... :-))
haikulazx64.JPG (147,349 bytes)   
haikulazx64.JPG (147,349 bytes)   

Alfred

2020-04-05 08:20

reporter   ~0121921

@juha.
The patchfile, included, as promissed.
Thanks.
haikux64.patch (999,440 bytes)

Juha Manninen

2020-04-05 09:13

developer   ~0121924

How did you generate the Makefiles? I don't see any Makefile.fpc.
What is xtensa-embedded?

Alfred

2020-04-05 09:26

reporter   ~0121925

Well.

I rewrote the updatemakefiles tool a bit. So it could work together with a fpcupdeluxe install of FPC and Lazarus.
Followed by a manual (but recursive) run of fpcmake through Lazarus.

The xtensa-target is a new target of FPC trunk.
I saw that the Lazarus Makefiles also contained entries for other embedded target. That is why it seemed handy to me just to have fpcmake add it into the Lazarus Makefiles. Two targets for the price of one !

No Makefile.fpc was touched. I just let fpcmake do its work.

Juha Manninen

2020-04-05 11:11

developer   ~0121929

> I rewrote the updatemakefiles tool a bit. So it could work together with a fpcupdeluxe install of FPC and Lazarus.
Where is the patch for the updatemakefiles tool?

> The xtensa-target is a new target of FPC trunk.
How did it end up to Makefiles if no Makefile.fpc was touched? As you see I don't understand the build system well. This may be a stupid question.

Alfred

2020-04-05 11:31

reporter   ~0121931

Don't worry, there can never be a stupid question. Only a stupid answer.
And, until yesterday, I was as "stupid" as you ... ;-)

After study of sources and binaries, this is what I learned.
Fpcmake scans the FPC sources of RTL and Packages. To determine what targets are available.
I did not dig deep to look into the details of the above process. But this is what I think now.

It uses the definitions inside Makefile.fpc to build a Makefile based on info from RTL and Packages.
So, the targets are NOT (necessary) listed in the Makefile.fpc itself.

About updatemakefiles.
Its not a goal or target of Lazarus to adjust towards fpcupdeluxe.
Its a goal and target of fpcupdeluxe to adjust towards Lazarus.
The tools are ok. Fpcupdeluxe will adjust to use these tools unchanged if possible.

Ps:
Few more (small) patches for Haiku will be added to this report.
I am in the process of enabling some more Lazarus packages for Haiku.

Alfred

2020-04-05 12:07

reporter   ~0121933

Here you go. Not that much patching. But results are very good !!
haikux64_2.patch (1,770 bytes)   
--- C:/fpclazbydeluxe/trunklatest2/lazarus/components/fpdebug/fpdbgcommon.pas	Tue Mar 17 18:57:56 2020
+++ C:/Users/Alfred/Documents/GitHub/lazarus/components/fpdebug/fpdbgcommon.pas	Sun Apr 05 10:01:25 2020
@@ -6,11 +6,11 @@
 
 type
 // Target information, could be different from host debugger
-  TMachineType = (mtNone, mtSPARC, mt386, mt68K, mtPPC, mtPPC64, mtARM,
+  TMachineType = (mtNone, mtSPARC, mt386, mt68K, mtPPC, mtPPC64, mtARM, mtARM64,
                   mtOLD_ALPHA, mtIA_64, mtX86_64, mtAVR8, mtALPHA);
   TBitness = (bNone, b32, b64);
   TByteOrder = (boNone, boLSB, boMSB);
-  TOperatingSystem = (osNone, osBSD, osDarwin, osEmbedded, osLinux, osMac, osWindows);
+  TOperatingSystem = (osNone, osBSD, osDarwin, osEmbedded, osLinux, osUnix, osMac, osWindows);
 
   TTargetDescriptor = record
     machineType: TMachineType;
@@ -32,6 +32,7 @@
     // TODO: Expand list when debugger support updated for other targets
     machineType := {$if defined(CPU386) or defined(CPUI386)} mt386
                    {$elseif defined(CPUX86_64) or defined(CPUAMD64) or defined(CPUX64)} mtX86_64
+                   {$elseif defined(CPUAARCH64)} mtARM64
                    {$elseif defined(CPUARM)} mtARM
                    {$elseif defined(CPUPOWERPC)} mtPPC
                    {$endif};
@@ -40,7 +41,10 @@
     byteorder   := {$ifdef ENDIAN_LITTLE} boLSB {$else} boMSB {$endif};
 
     OS          := {$if defined(DARWIN)} osDarwin
+                   {$elseif defined(EMBEDDED)} osEmbedded
                    {$elseif defined(LINUX)} osLinux
+                   {$elseif defined(BSD)} osBSD
+                   {$elseif defined(UNIX)} osUnix
                    {$elseif defined(MSWINDOWS)} osWindows {$endif};
   end;
 end;
haikux64_2.patch (1,770 bytes)   
haikux64_3.patch (7,974 bytes)   
--- C:/fpclazbydeluxe/trunklatest2/lazarus/ide/Makefile	Thu Mar 26 16:09:49 2020
+++ C:/Users/Alfred/Documents/GitHub/lazarus/ide/Makefile	Sun Apr 05 09:31:50 2020
@@ -2,7 +2,7 @@
 # Don't edit, this file is generated by FPCMake Version 2.0.0
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android i386-aros m68k-linux m68k-netbsd m68k-amiga m68k-atari m68k-palmos m68k-macos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-haiku x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-iphonesim x86_64-android x86_64-aros x86_64-dragonfly arm-linux arm-netbsd arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android arm-aros powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-embedded i8086-msdos i8086-win16 aarch64-linux aarch64-darwin aarch64-android wasm-wasm sparc64-linux riscv32-linux riscv32-embedded riscv64-linux riscv64-embedded
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android i386-aros m68k-linux m68k-netbsd m68k-amiga m68k-atari m68k-palmos m68k-macos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-haiku x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-iphonesim x86_64-android x86_64-aros x86_64-dragonfly arm-linux arm-netbsd arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android arm-aros powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-embedded i8086-msdos i8086-win16 aarch64-linux aarch64-darwin aarch64-android wasm-wasm sparc64-linux riscv32-linux riscv32-embedded riscv64-linux riscv64-embedded xtensa-embedded
 BSDs = freebsd netbsd openbsd darwin dragonfly
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom msdos win16 atari
@@ -687,6 +687,9 @@
 ifeq ($(FULL_TARGET),riscv64-embedded)
 override TARGET_PROGRAMS+=lazarus startlazarus lazbuild
 endif
+ifeq ($(FULL_TARGET),xtensa-embedded)
+override TARGET_PROGRAMS+=lazarus startlazarus lazbuild
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override CLEAN_FILES+=$(wildcard $(COMPILER_UNITTARGETDIR)/*$(OEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*$(PPUEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*$(RSTEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*.lfm) $(wildcard $(COMPILER_UNITTARGETDIR)/*.or) $(wildcard $(COMPILER_UNITTARGETDIR)/*.res) $(wildcard ../designer/*$(OEXT)) $(wildcard ../designer/*$(PPUEXT)) $(wildcard ../debugger/*$(OEXT)) $(wildcard ../debugger/*$(PPUEXT)) $(wildcard ../converter/*$(OEXT)) $(wildcard ../converter/*$(PPUEXT)) $(wildcard ../packager/*$(OEXT)) $(wildcard ../packager/*$(PPUEXT)) $(wildcard ../*$(OEXT)) $(wildcard ../*$(PPUEXT)) $(wildcard *$(OEXT)) $(wildcard *$(PPUEXT)) $(wildcard *$(RSTEXT))
 endif
@@ -963,6 +966,9 @@
 ifeq ($(FULL_TARGET),riscv64-embedded)
 override CLEAN_FILES+=$(wildcard $(COMPILER_UNITTARGETDIR)/*$(OEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*$(PPUEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*$(RSTEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*.lfm) $(wildcard $(COMPILER_UNITTARGETDIR)/*.or) $(wildcard $(COMPILER_UNITTARGETDIR)/*.res) $(wildcard ../designer/*$(OEXT)) $(wildcard ../designer/*$(PPUEXT)) $(wildcard ../debugger/*$(OEXT)) $(wildcard ../debugger/*$(PPUEXT)) $(wildcard ../converter/*$(OEXT)) $(wildcard ../converter/*$(PPUEXT)) $(wildcard ../packager/*$(OEXT)) $(wildcard ../packager/*$(PPUEXT)) $(wildcard ../*$(OEXT)) $(wildcard ../*$(PPUEXT)) $(wildcard *$(OEXT)) $(wildcard *$(PPUEXT)) $(wildcard *$(RSTEXT))
 endif
+ifeq ($(FULL_TARGET),xtensa-embedded)
+override CLEAN_FILES+=$(wildcard $(COMPILER_UNITTARGETDIR)/*$(OEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*$(PPUEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*$(RSTEXT)) $(wildcard $(COMPILER_UNITTARGETDIR)/*.lfm) $(wildcard $(COMPILER_UNITTARGETDIR)/*.or) $(wildcard $(COMPILER_UNITTARGETDIR)/*.res) $(wildcard ../designer/*$(OEXT)) $(wildcard ../designer/*$(PPUEXT)) $(wildcard ../debugger/*$(OEXT)) $(wildcard ../debugger/*$(PPUEXT)) $(wildcard ../converter/*$(OEXT)) $(wildcard ../converter/*$(PPUEXT)) $(wildcard ../packager/*$(OEXT)) $(wildcard ../packager/*$(PPUEXT)) $(wildcard ../*$(OEXT)) $(wildcard ../*$(PPUEXT)) $(wildcard *$(OEXT)) $(wildcard *$(PPUEXT)) $(wildcard *$(RSTEXT))
+endif
 override INSTALL_BASEDIR=share/lazarus/ide
 override INSTALL_FPCPACKAGE=n
 override DIST_DESTDIR=$(BASEDIR)/dist
@@ -1242,6 +1248,9 @@
 ifeq ($(FULL_TARGET),riscv64-embedded)
 override COMPILER_OPTIONS+=-gl -vbqewnhi -Sci -dlcl$(LCL_PLATFORM) $(DBG_OPTIONS)
 endif
+ifeq ($(FULL_TARGET),xtensa-embedded)
+override COMPILER_OPTIONS+=-gl -vbqewnhi -Sci -dlcl$(LCL_PLATFORM) $(DBG_OPTIONS)
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_INCLUDEDIR+=include include/$(OS_TARGET) ../images
 endif
@@ -1518,6 +1527,9 @@
 ifeq ($(FULL_TARGET),riscv64-embedded)
 override COMPILER_INCLUDEDIR+=include include/$(OS_TARGET) ../images
 endif
+ifeq ($(FULL_TARGET),xtensa-embedded)
+override COMPILER_INCLUDEDIR+=include include/$(OS_TARGET) ../images
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_UNITDIR+=../designer ../debugger ../debugger/frames ../converter ../packager ../packager/frames ../components/custom $(HEAPTRC_UNIT_PATH) frames .
 endif
@@ -1794,6 +1806,9 @@
 ifeq ($(FULL_TARGET),riscv64-embedded)
 override COMPILER_UNITDIR+=../designer ../debugger ../debugger/frames ../converter ../packager ../packager/frames ../components/custom $(HEAPTRC_UNIT_PATH) frames .
 endif
+ifeq ($(FULL_TARGET),xtensa-embedded)
+override COMPILER_UNITDIR+=../designer ../debugger ../debugger/frames ../converter ../packager ../packager/frames ../components/custom $(HEAPTRC_UNIT_PATH) frames .
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_TARGETDIR+=..
 endif
@@ -2070,6 +2085,9 @@
 ifeq ($(FULL_TARGET),riscv64-embedded)
 override COMPILER_TARGETDIR+=..
 endif
+ifeq ($(FULL_TARGET),xtensa-embedded)
+override COMPILER_TARGETDIR+=..
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM)
 endif
@@ -2346,6 +2364,9 @@
 ifeq ($(FULL_TARGET),riscv64-embedded)
 override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM)
 endif
+ifeq ($(FULL_TARGET),xtensa-embedded)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)/$(LCL_PLATFORM)
+endif
 ifdef REQUIRE_UNITSDIR
 override UNITSDIR+=$(REQUIRE_UNITSDIR)
 endif
@@ -3864,6 +3885,15 @@
 REQUIRE_PACKAGES_REGEXPR=1
 endif
 ifeq ($(FULL_TARGET),riscv64-embedded)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_LIBTAR=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_REGEXPR=1
+endif
+ifeq ($(FULL_TARGET),xtensa-embedded)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_FCL-PROCESS=1
haikux64_3.patch (7,974 bytes)   
haikux64test.JPG (104,096 bytes)   
haikux64test.JPG (104,096 bytes)   

Juha Manninen

2020-04-05 13:36

developer   ~0121938

Ok, I applied it after testing that building on Linux works.
Let's see if it gets feedback.

Alfred

2020-04-05 13:54

reporter   ~0121941

Thanks Juha !
I think it shows the quality of Lazarus (and its developers) that only a single, very small change, was needed to get things running on a brand new target.
Keep up the good work !!

Sven Barth

2020-04-06 17:39

manager   ~0121976

Last edited: 2020-04-06 17:40

View 2 revisions

Just as an explanation for the xtensa-embedded target: fpcmake contains a matrix of supported targets and updates the makefiles for *all* if -Tall is passed.

Alfred

2020-04-06 21:21

reporter   ~0121984

@Sven.
Thanks. But why does it need the FPC directory and a very strange way to get to the surces of RTL and Packages ?
I saw something like ..\bin\win32-i386/\../\..
(it looks into C:\PP id nothing is defined)
I needed to manually add the RTL and Packages sources into the FPC install directory to get it working.
Or am I totally wrong ?

Issue History

Date Modified Username Field Change
2019-11-15 13:44 Alfred New Issue
2019-11-15 13:48 Alfred File Added: FPCHaiku.JPG
2020-04-03 14:57 Juha Manninen Note Added: 0121864
2020-04-04 08:06 Alfred Note Added: 0121883
2020-04-04 09:53 Juha Manninen Note Added: 0121885
2020-04-04 10:08 Alfred Note Added: 0121886
2020-04-04 13:45 Juha Manninen Note Added: 0121892
2020-04-04 21:27 Alfred Note Added: 0121907
2020-04-04 22:24 Anton Kavalenka Note Added: 0121908
2020-04-05 06:19 Alfred File Added: haikux64.JPG
2020-04-05 06:19 Alfred Note Added: 0121916
2020-04-05 07:31 Alfred File Added: haikulazx64.JPG
2020-04-05 07:31 Alfred Note Added: 0121919
2020-04-05 08:20 Alfred File Added: haikux64.patch
2020-04-05 08:20 Alfred Note Added: 0121921
2020-04-05 09:13 Juha Manninen Assigned To => Juha Manninen
2020-04-05 09:13 Juha Manninen Status new => feedback
2020-04-05 09:13 Juha Manninen LazTarget => -
2020-04-05 09:13 Juha Manninen Note Added: 0121924
2020-04-05 09:26 Alfred Note Added: 0121925
2020-04-05 09:26 Alfred Status feedback => assigned
2020-04-05 11:11 Juha Manninen Note Added: 0121929
2020-04-05 11:31 Alfred Note Added: 0121931
2020-04-05 12:07 Alfred File Added: haikux64_2.patch
2020-04-05 12:07 Alfred File Added: haikux64_3.patch
2020-04-05 12:07 Alfred File Added: haikux64test.JPG
2020-04-05 12:07 Alfred Note Added: 0121933
2020-04-05 13:36 Juha Manninen Status assigned => resolved
2020-04-05 13:36 Juha Manninen Resolution open => fixed
2020-04-05 13:36 Juha Manninen Fixed in Revision => r62890
2020-04-05 13:36 Juha Manninen Widgetset QT5 => QT5
2020-04-05 13:36 Juha Manninen Note Added: 0121938
2020-04-05 13:54 Alfred Note Added: 0121941
2020-04-06 17:39 Sven Barth Note Added: 0121976
2020-04-06 17:40 Sven Barth Note Edited: 0121976 View Revisions
2020-04-06 21:21 Alfred Note Added: 0121984