diff --git a/templates/glibc.tmpl b/templates/glibc.tmpl index 9475fd7a851..0709856edab 100644 --- a/templates/glibc.tmpl +++ b/templates/glibc.tmpl @@ -30,6 +30,11 @@ pre_configure() mkdir -p $wrksrc/build_obj && cd $wrksrc/build_obj wrksrc=$wrksrc/build_obj echo "slibdir=/lib" > $wrksrc/configparms + # glibc fails to build if -march not set for a minimal cpu. + if [ "$xbps_machine" != "x86_64" ]; then + echo "CFLAGS+=-march=${xbps_machine%%-*} -mtune=generic" \ + >> $wrksrc/configparms + fi } pre_install()