git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] makefile: update detect-compiler for newer Xcode version

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 6, 2021, 18:11 UTC
Message-ID
<xmqq8s1eigto.fsf@gitster.g>
In-Reply-To
<m2sfzmu1t7.fsf@gmail.com>
Atharva Raykar <raykar.ath@gmail.com> writes:
Show 23 quoted lines
> Carlo Marcelo Arenas Belón <carenas@gmail.com> writes:
>
> For those of us using Homebrew and using the LLVM installation from
> there, we get:
>
> $ cc --version
> Homebrew clang version 12.0.1
> ...
>> diff --git a/detect-compiler b/detect-compiler
>> index 70b754481c..c85be83c64 100755
>> --- a/detect-compiler
>> +++ b/detect-compiler
>> @@ -44,7 +44,7 @@ clang)
>>  "FreeBSD clang")
>>  	print_flags clang
>>  	;;
>> -"Apple LLVM")
>> +"Apple LLVM"|"Apple clang")
>>  	print_flags clang
>>  	;;
>>  *)
>
> So maybe we could add another case for "Homebrew clang"?

$ clang --version 2>&1 | sed -ne 's/ version .*//p' Debian clang

It might be necessary to cope with this "$VENDOR clang version" convention better with something like the following.

I am afraid that this patch is being a bit too aggressive about LLVM, as I do not know if "$VENDOR LLVM version" is also a thing, or it is just oddity only at Apple, though.

diff --git c/detect-compiler w/detect-compiler
index 70b754481c..a80442a327 100755
--- c/detect-compiler
+++ w/detect-compiler
@@ -38,13 +38,7 @@ case "$(get_family)" in
 gcc)
 	print_flags gcc
 	;;
-clang)
-	print_flags clang
-	;;
-"FreeBSD clang")
-	print_flags clang
-	;;
-"Apple LLVM")
+clang | *" clang" | *" LLVM")
 	print_flags clang
 	;;
 *)
Previous: Atharva RaykarNext: Jeff King
Message 6 of 22 in “makefile: update detect-compiler for newer Xcode version”
  1. makefile: update detect-compiler for newer Xcode versionCarlo Marcelo Arenas Belón, Aug 6, 2021
  2. Bagas SanjayaAug 6, 2021
  3. Carlo ArenasAug 6, 2021
  4. Eric SunshineAug 6, 2021
  5. Atharva RaykarAug 6, 2021
  6. Junio C HamanoAug 6, 2021
  7. Jeff KingAug 6, 2021
  8. 0/3 detect-compiler: clang updatesJunio C Hamano, Aug 6, 2021
  9. 1/3 build: update detect-compiler for newer Xcode versionJunio C Hamano, Aug 6, 2021
  10. 2/3 build: clang version may not be followed by extra wordsJunio C Hamano, Aug 6, 2021
  11. 3/3 build: catch clang that identifies itself as "$VENDOR clang"Junio C Hamano, Aug 6, 2021
  12. Jeff KingAug 7, 2021
  13. Ævar Arnfjörð BjarmasonAug 7, 2021
  14. Jeff KingAug 7, 2021
  15. Ævar Arnfjörð BjarmasonAug 7, 2021
  16. Jeff KingAug 7, 2021
  17. Ævar Arnfjörð BjarmasonAug 7, 2021
  18. Jeff KingAug 7, 2021
  19. Ævar Arnfjörð BjarmasonAug 7, 2021
  20. Jeff KingAug 9, 2021
  21. Carlo ArenasAug 8, 2021
  22. Jeff KingAug 9, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.