You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Arch系统下FLINT/C库安装报错:ld提示-r与-pie无法同时使用

Fixing FLINT 2.4.5 Compilation Error on Arch Linux: -r and -pie may not be used together

I’ve run into this exact issue before with older C libraries on Arch—here’s what’s going on and how to fix it quickly:

Arch Linux sets GCC to enable position-independent executables (PIE) by default for security reasons, but FLINT 2.4.5 is an older release whose build system doesn’t account for this. The linker error happens because FLINT uses the -r flag (to create relocatable object files) which conflicts with the default -pie linker flag.

Here are two reliable fixes:

1. Quick Temporary Fix: Override Flags When Running Make

Just pass the PIE-disabling flags directly to make—this avoids editing any source files:

make CFLAGS="-fno-pie" LDFLAGS="-no-pie" && sudo make install

You’ll need sudo for make install since it installs files to system-wide directories like /usr/local/lib and /usr/local/include.

2. Permanent Fix: Edit FLINT’s Root Makefile

If you plan to recompile FLINT later or want the flags baked into the build:

  • Open the Makefile in your flint-2.4.5 directory
  • Find the lines defining CFLAGS and LDFLAGS
  • Add -fno-pie to the CFLAGS line, and -no-pie to the LDFLAGS line. For example:
    CFLAGS = -O2 -fno-pie -Wall ... (keep existing flags)
    LDFLAGS = -no-pie ... (keep existing flags)
    
  • Save the file, then run make && sudo make install as normal.

Once you’ve completed either fix, test the installation by compiling a small program that links against FLINT to confirm everything works as expected.

内容的提问来源于stack exchange,提问作者user9111001

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 07:57:03