From 45fc515400db981d1bc9f9bf94435b23943f9752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Wed, 25 Nov 2020 01:48:36 +0000 Subject: [PATCH] sinclairql: added platform specific options to allow specifying executable metadata format git-svn-id: trunk@47567 - --- compiler/globals.pas | 6 +++++- compiler/msg/errore.msg | 3 +++ compiler/msgidx.inc | 2 +- compiler/msgtxt.inc | 48 ++++++++++++++++++++++------------------- compiler/options.pas | 17 +++++++++++++++ 5 files changed, 52 insertions(+), 24 deletions(-) diff --git a/compiler/globals.pas b/compiler/globals.pas index 1259b57963..67455bd31a 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -413,6 +413,10 @@ interface palmos_applicationname : string = 'FPC Application'; palmos_applicationid : string[4] = 'FPCA'; {$endif defined(m68k) or defined(arm)} +{$if defined(m68k)} + { Sinclair QL specific } + sinclairql_metadata_format: string[4] = 'QHDR'; +{$endif defined(m68k)} { default name of the C-style "main" procedure of the library/program } { (this will be prefixed with the target_info.cprefix) } @@ -1510,7 +1514,7 @@ implementation if localexepath='' then begin hs1 := ExtractFileName(exeName); - hs1 := ChangeFileExt(hs1,source_info.exeext); + hs1 := ChangeFileExt(hs1,source_info.exeext); {$ifdef macos} FindFile(hs1,GetEnvironmentVariable('Commands'),false,localExepath); {$else macos} diff --git a/compiler/msg/errore.msg b/compiler/msg/errore.msg index a116d0f5c6..0e99b45034 100644 --- a/compiler/msg/errore.msg +++ b/compiler/msg/errore.msg @@ -4319,6 +4319,9 @@ A*2WR_Generate relocation code (Windows) 8*3Wtexe_Create a DOS .EXE file (default) 8*3Wtcom_Create a DOS .COM file (requires tiny memory model) P*2WT_Specify MPW tool type application (Classic Mac OS) +6*2WQ_Set executable metadata format (Sinclair QL) +6*3WQqhdr_Set metadata to QDOS File Header style +6*3WQxtcc_Set metadata to XTcc style **2WX_Enable executable stack (Linux) **1X_Executable options: **2X9_Generate linkerscript for GNU Binutils ld older than version 2.19.1 (Linux) diff --git a/compiler/msgidx.inc b/compiler/msgidx.inc index 431ff59c5b..6c325aa3eb 100644 --- a/compiler/msgidx.inc +++ b/compiler/msgidx.inc @@ -1135,7 +1135,7 @@ const option_info=11024; option_help_pages=11025; - MsgTxtSize = 86604; + MsgTxtSize = 86744; MsgIdxMax : array[1..20] of longint=( 28,107,360,130,99,63,145,36,223,68, diff --git a/compiler/msgtxt.inc b/compiler/msgtxt.inc index 6cb6919086..01d4563004 100644 --- a/compiler/msgtxt.inc +++ b/compiler/msgtxt.inc @@ -1,8 +1,8 @@ const msgtxt_codepage=20127; {$ifdef Delphi} -const msgtxt : array[0..000360] of string[240]=( +const msgtxt : array[0..000361] of string[240]=( {$else Delphi} -const msgtxt : array[0..000360,1..240] of char=( +const msgtxt : array[0..000361,1..240] of char=( {$endif Delphi} '01000_T_Compiler: $1'#000+ '01001_D_Compiler OS: $1'#000+ @@ -1960,42 +1960,46 @@ const msgtxt : array[0..000360,1..240] of char=( '8*3Wtexe_Create a DOS .EXE file (default)'#010+ '8*3Wtcom_Create a DOS .COM file (requires tiny memory model)'#010+ 'P*2WT_Specify MPW tool type application (Classic Mac OS)'#010+ + '6*2WQ_Set executable metadata format (Sinclair QL)'#010+ + '6*3WQqhdr_Set metad','ata to QDOS File Header style'#010+ + '6*3WQxtcc_Set metadata to XTcc style'#010+ '**2WX_Enable executable stack (Linux)'#010+ '**1X_Executable options:'#010+ - '**2X9_Gene','rate linkerscript for GNU Binutils ld older than version 2'+ - '.19.1 (Linux)'#010+ - '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Lin'+ - 'ux)'#010+ + '**2X9_Generate linkerscript for GNU Binutils ld older than version 2.1'+ + '9.1 (Linux)'#010+ + '**2Xc_Pass --shared/-dynamic',' to the linker (BeOS, Darwin, FreeBSD, L'+ + 'inux)'#010+ '**2Xd_Do not search default library path (sometimes required for cross'+ - '-compiling when not usin','g -XR)'#010+ + '-compiling when not using -XR)'#010+ '**2Xe_Use external linker'#010+ '**2Xf_Substitute pthread library name for linking (BSD)'#010+ - '**2Xg_Create debuginfo in a separate file and add a debuglink section '+ - 'to executable'#010+ - '**2XD_Try to link units dynamically (defines FPC_LINK_DYNAMIC)',#010+ + '**2Xg_Creat','e debuginfo in a separate file and add a debuglink sectio'+ + 'n to executable'#010+ + '**2XD_Try to link units dynamically (defines FPC_LINK_DYNAMIC)'#010+ '**2Xi_Use internal linker'#010+ 'L*2XlS_LLVM utilties suffix (e.g. -7 in case clang is called clang-'+ - '7)'#010+ + '7)'#010, '**2XLA_Define library substitutions for linking'#010+ '**2XLO_Define order of library linking'#010+ '**2XLD_Exclude default order of standard libraries'#010+ - '**','2Xm_Generate link map'#010+ + '**2Xm_Generate link map'#010+ '**2XM_Set the name of the '#039'main'#039' program routine (default i'+ 's '#039'main'#039')'#010+ - '**2Xn_Use target system native linker instead of GNU ld (Solaris, AIX)'+ - #010+ + '**2Xn_','Use target system native linker instead of GNU ld (Solaris, AI'+ + 'X)'#010+ 'F*2Xp_First search for the compiler binary in the directory '#010+ - '**2XP','_Prepend the binutils names with the prefix '#010+ - '**2Xr_Set the linker'#039's rlink-path to (needed for cross comp'+ - 'ile, see the ld manual for more information) (BeOS, Linux)'#010+ - '**2XR_Prepend to all linker search paths (BeOS, Darwin, Free','B'+ - 'SD, Linux, Mac OS, Solaris)'#010+ + '**2XP_Prepend the binutils names with the prefix '#010+ + '**2Xr_Set the linker'#039's rlink-path to (needed ','for cross co'+ + 'mpile, see the ld manual for more information) (BeOS, Linux)'#010+ + '**2XR_Prepend to all linker search paths (BeOS, Darwin, FreeBSD'+ + ', Linux, Mac OS, Solaris)'#010+ '**2Xs_Strip all symbols from executable'#010+ - '**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)'#010+ + '**2XS_Try to link units statica','lly (default, defines FPC_LINK_STATIC'+ + ')'#010+ '**2Xt_Link with static libraries (-static is passed to linker)'#010+ - '**2Xv_Generate table for Virtual Entry',' calls'#010+ + '**2Xv_Generate table for Virtual Entry calls'#010+ '**2XV_Use VLink as external linker (default on Amiga, MorphOS)'#010+ - '**2XX_Try to smartlink units (defines FPC_LINK_SMART)'#010+ + '**2XX_Try to smartlink u','nits (defines FPC_LINK_SMART)'#010+ '**1*_'#010+ '**1?_Show this help'#010+ '**1h_Shows this help without waiting' diff --git a/compiler/options.pas b/compiler/options.pas index 183467d105..117c1903bd 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -2601,6 +2601,23 @@ begin else IllegalPara(opt); end; +{$if defined(m68k)} + 'Q': + begin + if (target_info.system in [system_m68k_sinclairql]) then + begin + sinclairql_metadata_format:=Upper(Copy(More,j+1,255)); + case sinclairql_metadata_format of + 'QHDR', 'XTCC': ; { allowed formats } + else + IllegalPara(opt); + end; + break; + end + else + IllegalPara(opt); + end; +{$endif defined(m68k)} 'R': begin if target_info.system in systems_all_windows then