Menu

#197 Project failed to build on environment with clang

Future
open
None
5
2023-03-05
2023-03-05
Xiao Hanyu
No

Hello,

This is a following issue after https://sourceforge.net/p/xetex/bugs/195/.

I found that if a system contains both gcc and clang, then the build will fail (build log attached).

The rationale here is, most of the libs would use gcc to compile, while libs/icu prefer to use clang over gcc.

To override this and force to use gcc for compiling libs/icu, there're several ways:
1. call build.sh with CC=gcc CXX=g++ ./build.sh
2. modify build.sh:
```
diff --git a/build.sh b/build.sh
index 4e556321..f21c859a 100755
--- a/build.sh
+++ b/build.sh
@@ -189,7 +189,7 @@ fi

 if [ "$ONLY_MAKE" = "FALSE" ]
 then
  • TL_MAKE=$MAKE ../source/configure $CONFHOST $CONFBUILD $WARNINGFLAGS $CONF_OPTIONS || exit 1
  • CC=gcc CXX=g++ TL_MAKE=$MAKE ../source/configure $CONFHOST $CONFBUILD $WARNINGFLAGS $CONF_OPTIONS || exit 1
    fi

    $MAKE || exit 1
    `` 3. modify libs/icu by changing libs/icu's [configure.ac](https://github.com/TeX-Live/xetex/blob/master/source/libs/icu/icu-55.1/source/configure.ac#L133-L136) and [configure](https://github.com/TeX-Live/xetex/blob/master/source/libs/icu/icu-55.1/source/configure) to remove clang as a candidate compiler inAC_PROG_CC` macro.

Which way do you prefer? I can provide a patch if necessary.

Thanks!

1 Attachments

Discussion

  • Xiao Hanyu

    Xiao Hanyu - 2023-03-05

    Shitty format, revised:

    To override this and force to use gcc for compiling libs/icu, there're several ways:

    • call build.sh with CC=gcc CXX=g++ ./build.sh
    • modify build.sh:
    diff --git a/build.sh b/build.sh
    index 4e556321..f21c859a 100755
    --- a/build.sh
    +++ b/build.sh
    @@ -189,7 +189,7 @@ fi
    
    if [ "$ONLY_MAKE" = "FALSE" ]
    then
    -    TL_MAKE=$MAKE ../source/configure $CONFHOST $CONFBUILD $WARNINGFLAGS $CONF_OPTIONS || exit 1
    +    CC=gcc CXX=g++ TL_MAKE=$MAKE ../source/configure $CONFHOST $CONFBUILD $WARNINGFLAGS $CONF_OPTIONS || exit 1
    fi
    
    $MAKE || exit 1
    
    • modify libs/icu by changing libs/icu's configure.ac and configure to remove clang as a candidate compiler inAC_PROG_CC` macro.
     

    Last edit: Xiao Hanyu 2023-03-05
  • Xiao Hanyu

    Xiao Hanyu - 2023-03-05

    I kind of prefer approach 2 here, by modifying build.sh and force the project to use gcc/g++.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB