作为一个lazarus用户,早闻fpcupdeluxe大名,听说能保留配置升级IDE/FPC,很是强大。终于在一次更新时,我把环境换到了fpcupdeluxe,然后进行安装,结果报错:
The x86_64 target OS is not (yet) support by the FPC/LLVM code generator.
我本以为是一个常见错误,在群里咨询老用户,发现并没有人遇到过,在互联网也无法搜到任何一个相关信息,这就有点奇怪了,竟然是个例。
完整报错如下:
fpcupdeluxe: Executing: D:\Program Files\Git\cmd\git.exe remote -v (working dir: D:\fpcupdeluxe2\fpcsrc)
origin https://gitlab.com/freepascal.org/fpc/source.git/ (fetch)
origin https://gitlab.com/freepascal.org/fpc/source.git/ (push)
fpcupdeluxe: Executing: D:\Program Files\Git\cmd\git.exe describe --tags --abbrev=0 (working dir: D:\fpcupdeluxe2\fpcsrc)
release_3_2_2
fpcupdeluxe: Executing: D:\Program Files\Git\cmd\git.exe pull (working dir: D:\fpcupdeluxe2\fpcsrc)
Already up to date.
fpcupdeluxe: Executing: D:\Program Files\Git\cmd\git.exe log -1 --pretty=format:%h (working dir: D:\fpcupdeluxe2\fpcsrc)
0d122c49
fpcupdeluxe: Executing: D:\Program Files\Git\cmd\git.exe describe HEAD (working dir: D:\fpcupdeluxe2\fpcsrc)
fatal: No annotated tags can describe '0d122c49534b480be9284c21bd60b53d99904346'.
However, there were unannotated tags: try --tags.
fpcupdeluxe: Executing: D:\Program Files\Git\cmd\git.exe describe --tags --exact-match HEAD (working dir: D:\fpcupdeluxe2\fpcsrc)
release_3_2_2
fpcupdeluxe: info: FPC Native Installer (GitClient: FPC): Current commit name: release_3_2_2.
fpcupdeluxe: Executing: D:\Program Files\Git\cmd\git.exe show -s --format=%s%b (working dir: D:\fpcupdeluxe2\fpcsrc)
requiredversion to 3.2.0 and 3.2.2git-svn-id: tags/release_3_2_2@49371 -
fpcupdeluxe: info: FPC Native Installer (GitClient: FPC): Current commit message: requiredversion to 3.2.0 and 3.2.2git-svn-id: tags/release_3_2_2@49371 -.
fpcupdeluxe: info: FPC Native Installer (GetModule: FPC): FPC was at revision/hash: FRET_UNKNOWN_REVISION.
fpcupdeluxe: info: FPC Native Installer (GetModule: FPC): FPC is now at revision/hash: 0d122c49.
fpcupdeluxe: Executing: D:\Program Files\Git\cmd\git.exe describe HEAD (working dir: D:\fpcupdeluxe2\fpcsrc)
fatal: No annotated tags can describe '0d122c49534b480be9284c21bd60b53d99904346'.
However, there were unannotated tags: try --tags.
fpcupdeluxe: Executing: D:\Program Files\Git\cmd\git.exe describe --tags --exact-match HEAD (working dir: D:\fpcupdeluxe2\fpcsrc)
release_3_2_2
fpcupdeluxe: info: FPC Native Installer (GetModule: FPC): No FPC patches defined.
fpcupdeluxe: info: FPC Native Installer (BuildModule: FPC): Going to build FPC.
fpcupdeluxe: info: FPC Native Installer (BuildModule: FPC): Detected source version FPC (source): 3.2.2.
fpcupdeluxe: info: FPC Native Installer (BuildModule: FPC): To compile this FPC, we need (required) a compiler with version 3.2.0 or 3.2.2.
fpcupdeluxe: info: FPC Native Installer (BuildModule: FPC): To compile this FPC, we will use the (already available) compiler with version : 3.2.2.
Found valid make.exe application.
fpcupdeluxe: info: FPC Native Installer (BuildModuleCustom: FPC): Using FPC bootstrap compiler with version: 3.2.2.
fpcupdeluxe: info: FPC Native Installer (BuildModuleCustom: FPC): Running CleanModule once more, due to previous clean failure.
fpcupdeluxe: info: FPC Native Installer (CleanModule: FPC): Running make distclean twice.
fpcupdeluxe: Executing: D:\fpcupdeluxe2\fpcbootstrap\make.exe --directory=D:\fpcupdeluxe2\fpcsrc FPC=D:/fpcupdeluxe2/fpcbootstrap/ppcx64.exe FPCMAKE=D:/fpcupdeluxe2/fpc/bin/x86_64-win64/fpcmake.exe PPUMOVE=D:/fpcupdeluxe2/fpc/bin/x86_64-win64/ppumove.exe FPCDIR=D:/fpcupdeluxe2/fpcsrc PREFIX=D:/fpcupdeluxe2/fpc INSTALL_PREFIX=D:/fpcupdeluxe2/fpc CPU_SOURCE=x86_64 OS_SOURCE=win64 UPXPROG=echo CPU_TARGET=x86_64 OS_TARGET=win64 distclean (working dir: D:\fpcupdeluxe2\fpcsrc)
D:/fpcupdeluxe2/fpcbootstrap/make.exe -C compiler distclean
makefile:508: *** The x86_64 target OS is not (yet) support by the FPC/LLVM code generator. Stop.
D:\fpcupdeluxe2\fpcbootstrap\make.exe: *** [compiler_distclean] Error 2
fpcupdeluxe: info: FPC Native Installer (BuildModule: FPC): Now building FPC.
fpcupdeluxe: info: FPC Native Installer (BuildModule: FPC): Adding -dFPC_SOFT_FPUX80 to compiler option to enable 80bit (soft)float support (trunk only).
fpcupdeluxe: Executing: D:\fpcupdeluxe2\fpcbootstrap\make.exe PP=D:/fpcupdeluxe2/fpcbootstrap/ppcx64.exe FPCDIR=D:/fpcupdeluxe2/fpcsrc FPCMAKE=D:/fpcupdeluxe2/fpc/bin/x86_64-win64/fpcmake.exe PPUMOVE=D:/fpcupdeluxe2/fpc/bin/x86_64-win64/ppumove.exe PREFIX=D:/fpcupdeluxe2/fpc INSTALL_PREFIX=D:/fpcupdeluxe2/fpc INSTALL_SOURCEDIR=D:/fpcupdeluxe2/fpcsrc INSTALL_BASEDIR=D:/fpcupdeluxe2/fpc INSTALL_UNITDIR=D:/fpcupdeluxe2/fpc/units/x86_64-win64 INSTALL_BINDIR=D:/fpcupdeluxe2/fpc/bin/x86_64-win64 INSTALL_LIBDIR=D:/fpcupdeluxe2/fpc/lib INSTALL_SHAREDDIR=D:/fpcupdeluxe2/fpc/share INSTALL_DATADIR=D:/fpcupdeluxe2/fpc/data OS_SOURCE=win64 CPU_SOURCE=x86_64 OS_TARGET=win64 CPU_TARGET=x86_64 UPXPROG=echo GIT=D:/PROGRA~1/Git/cmd/git.exe REVSTR=0d122c49 REVINC=force OPT=-vw-n-h-l-d-u-t-p-c- -dFPC_SOFT_FPUX80 --directory=D:\fpcupdeluxe2\fpcsrc all (working dir: D:\fpcupdeluxe2\fpcsrc)
D:/fpcupdeluxe2/fpcbootstrap/make.exe compiler_cycle RELEASE=1
D:/fpcupdeluxe2/fpcbootstrap/make.exe -C compiler cycle
makefile:508: *** The x86_64 target OS is not (yet) support by the FPC/LLVM code generator. Stop.
make.exe[1]: *** [compiler_cycle] Error 2
D:\fpcupdeluxe2\fpcbootstrap\make.exe: *** [build-stamp.x86_64-win64] Error 2
fpcupdeluxe: ERROR: FPC Native Installer (BuildModule: FPC): Error running D:\fpcupdeluxe2\fpcbootstrap\make.exe for FPC failed with exit code 2
. Details: .
ERROR: Fpcupdeluxe fatal error !
Sequencer (FPC): Failure running fpcupdeluxe: error executing sequence FPC
Sequencer (Only): Failure running fpcupdeluxe: error executing sequence Only
多次尝试,包括关机重启、更换fpcupdeluxe版本、切换网络环境均无法解决,此次不得不怀疑我电脑上有些个性化配置和它的构建冲突了。
下面去fpc的源码里,搜一下,什么时候会这个报错
The x86_64 target OS is not (yet) support by the FPC/LLVM code generator.
一共有两个引用,分别是Makefile和Makefile.fpc
仔细看,原来是如果有LLVM被定义,就会进入下面的代码,而根据它的逻辑,只有Darwin、iphonesim、Linux允许使用LLVM,那这个LLVM在哪里被错误定义了吗。
我决定修改一下编译脚本,把LLVM的值打印出来。
如上修改,这样再报错会把LLVM的值显示出来。
结果:
好家伙,这不是我本地安装的LLVM编译器吗,咋会被fpc检索到?难道是系统变量污染了?
结束。
要想出现这个Bug,需要本就不支持LLVM的CPU/系统,例如Windows,还要恰好定义了LLVM的系统变量,很严苛的复现条件,我能在第一次使用就遇到也算是时运不齐了。