Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase on llvm 16 #421

Merged
merged 23 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7e88dcb
Rebase our changes on top of llvm release/16.x branch
directhex May 19, 2023
167ba7c
Force non-cross "native" compiler to clang
directhex May 22, 2023
a2cd55e
Include prior work updating objwriter to compile on LLVM 16
directhex May 22, 2023
25a5dc7
Fix EXTERNALIZE_DEBUGINFO changes in AddLLVM.cmake
directhex May 22, 2023
3fce168
tblgen isn't enough to cross-compile these days. Native build more
directhex May 23, 2023
d7e79b5
Use Ubuntu 18.04 images FOR NOW
directhex May 23, 2023
5e7c4f5
Don't enable zstd, we can't use it from Brew on arm64 builds on x64
directhex May 23, 2023
907f6ae
Build libcxx, and use it instead of libstdc++, on Linux
directhex May 25, 2023
2407f6b
Fix version numbering
directhex May 25, 2023
155484b
Do libcxx stripping post-hoc in MSBuild, since CMake is being a pain
directhex Jun 1, 2023
4d8cad6
Fix Musl build
directhex Jun 2, 2023
5047696
Merge branch 'release/16.x' into rebase-on-llvm-16
directhex Jun 2, 2023
e640fb8
CI against any main branch, not just the "real" main branch
directhex Jun 2, 2023
7a7c0a8
Add support to emit ELF comment section (#413)
am11 May 12, 2023
b19cb46
Remove Windows arm32 packages. (#419)
directhex May 23, 2023
366aa94
Port build yml changes to azure-pipelines-codeql.yml
akoeplinger Jun 1, 2023
ad25430
Disable CodeQL in main azure-pipelines.yml
akoeplinger Jun 1, 2023
3942288
Only use x64_release for Windows in azure-pipelines-codeql.yml
akoeplinger Jun 1, 2023
d823169
Add a -mono suffix to the output of llvm-config --version. Also add a…
vargaz Feb 19, 2016
2e6c02f
Add a 'mono.this' custom metadata, this is used to mark an 'alloca' w…
vargaz Feb 19, 2016
d9feb4d
Re-add LLVMMono1CallConv
directhex Jun 6, 2023
4d8ebd5
Idiot copy-paste error
directhex Jun 6, 2023
a801b5e
Set TWO rpaths, so both ../lib/ and ./ work
directhex Jun 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .config/tsaoptions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"instanceUrl": "https://devdiv.visualstudio.com/",
"template": "TFSDEVDIV",
"projectName": "DEVDIV",
"areaPath": "DevDiv\\mono",
"iterationPath": "DevDiv",
"notificationAliases": [ "runtimerepo-infra@microsoft.com" ],
"repositoryName": "llvm-project",
"codebaseName": "llvm-project"
}
5 changes: 0 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,7 @@ pythonenv*
/clang/utils/analyzer/projects/*/RefScanBuildResults
# automodapi puts generated documentation files here.
/lldb/docs/python_api/

/artifacts
/.dotnet
/.packages
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Import Project="dir.common.props" />
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
</Project>
4 changes: 4 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
</Project>
16 changes: 16 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<configuration>
<!-- Don't use any higher level config files.
Our builds need to be isolated from user/machine state -->
<fallbackPackageFolders>
<clear />
</fallbackPackageFolders>
<packageSources>
<clear />
<add key="dotnet-public" value="https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet-public/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
</disabledPackageSources>
</configuration>
31 changes: 0 additions & 31 deletions bolt/utils/docker/Dockerfile

This file was deleted.

8 changes: 8 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@echo off
setlocal

set _args=%*
if "%~1"=="-?" set _args=-help

powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0eng\build.ps1" %_args%
exit /b %ERRORLEVEL%
33 changes: 33 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

source="${BASH_SOURCE[0]}"

function is_cygwin_or_mingw()
{
case $(uname -s) in
CYGWIN*) return 0;;
MINGW*) return 0;;
*) return 1;;
esac
}

# resolve $SOURCE until the file is no longer a symlink
while [[ -h $source ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"

# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done

scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"

if is_cygwin_or_mingw; then
# if bash shell running on Windows (not WSL),
# pass control to powershell build script.
scriptroot=$(cygpath -d "$scriptroot")
powershell -c "$scriptroot\\build.cmd" $@
else
"$scriptroot/eng/build.sh" $@
fi
50 changes: 50 additions & 0 deletions clang/cmake/modules/AddClang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,56 @@ macro(add_clang_tool name)
DEPENDS ${name}
COMPONENT ${name})
endif()

if(APPLE)
if(LLVM_EXTERNALIZE_DEBUGINFO_INSTALL)
if(LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION)
set(file_ext ${LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION})
elseif(LLVM_EXTERNALIZE_DEBUGINFO_FLATTEN)
set(file_ext dwarf)
else()
set(file_ext dSYM)
endif()
set(output_name "$<TARGET_FILE_NAME:${name}>.${file_ext}")
if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR)
set(output_path "${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR}/${output_name}")
else()
set(output_path "${output_name}")
endif()
get_filename_component(debuginfo_absolute_path ${output_path} REALPATH BASE_DIR $<TARGET_FILE_DIR:${name}>)
install(FILES ${debuginfo_absolute_path} DESTINATION bin OPTIONAL COMPONENT ${name})
endif()
elseif(WIN32)
if(LLVM_EXTERNALIZE_DEBUGINFO_INSTALL)
install(FILES $<TARGET_PDB_FILE:${name}> DESTINATION bin OPTIONAL COMPONENT ${name})
endif()
else()
if(LLVM_EXTERNALIZE_DEBUGINFO_INSTALL)
if(LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION)
set(file_ext ${LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION})
else()
set(file_ext debug)
endif()

set(output_name "$<TARGET_FILE_NAME:${name}>.${file_ext}")

if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR)
set(output_path "${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR}/${output_name}")
# If an output dir is specified, it must be manually mkdir'd on Linux,
# as that directory needs to exist before we can pipe to a file in it.
add_custom_command(TARGET ${name} POST_BUILD
WORKING_DIRECTORY ${LLVM_RUNTIME_OUTPUT_INTDIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR}
)
else()
set(output_path "${output_name}")
endif()

get_filename_component(debuginfo_absolute_path ${output_path} REALPATH BASE_DIR $<TARGET_FILE_DIR:${name}>)
install(FILES ${debuginfo_absolute_path} DESTINATION bin OPTIONAL COMPONENT ${name})
endif()
endif()

set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name})
endif()
endif()
Expand Down
41 changes: 0 additions & 41 deletions clang/tools/clang-fuzzer/Dockerfile

This file was deleted.

74 changes: 0 additions & 74 deletions clang/utils/analyzer/Dockerfile

This file was deleted.

85 changes: 85 additions & 0 deletions dir.common.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<Project>

<!-- Set default Configuration and Platform -->
<PropertyGroup>
<BuildArch>$(__BuildArch)</BuildArch>
<BuildArch Condition="'$(__BuildArch)'==''">x64</BuildArch>
<BuildArch Condition="'$(__BuildArch)' == 'amd64'">x64</BuildArch>

<BuildType>$(__BuildType)</BuildType>
<BuildType Condition="'$(__BuildType)'==''">Debug</BuildType>
<BuildType Condition="'$(__BuildType)' == 'debug'">Debug</BuildType>
<BuildType Condition="'$(__BuildType)' == 'release'">Release</BuildType>
<BuildType Condition="'$(__BuildType)' == 'checked'">Checked</BuildType>

<BuildOS>$(__BuildOS)</BuildOS>
<BuildOS Condition="'$(__BuildOS)' == '' And '$([MSBuild]::IsOSPlatform(Windows))' == 'true'">Windows_NT</BuildOS>
<BuildOS Condition="'$(__BuildOS)' == '' And '$([MSBuild]::IsOSPlatform(Linux))' == 'true'">Linux</BuildOS>
<BuildOS Condition="'$(__BuildOS)' == '' And '$([MSBuild]::IsOSPlatform(OSX))' == 'true'">OSX</BuildOS>

<!-- TODO: converge on one property for BuildOS and __BuildOS (and similar), and remove these extra lines. -->
<__BuildOS>$(BuildOS)</__BuildOS>
<__BuildArch>$(BuildArch)</__BuildArch>

<Configuration Condition="'$(Configuration)' == ''">$(BuildType)</Configuration>
<Platform Condition="'$(Platform)' == ''">$(BuildArch)</Platform>

<PlatformConfigPathPart>$(BuildOS).$(BuildArch).$(BuildType)</PlatformConfigPathPart>

</PropertyGroup>

<!-- Common properties -->
<PropertyGroup>

<__ProjectDir Condition="'$(__ProjectDir)'==''">$(MSBuildThisFileDirectory)</__ProjectDir>
<ProjectDir>$(__ProjectDir)\</ProjectDir>
<RootRepoDir>$(ProjectDir)\..\..\</RootRepoDir>
<ProjectDir Condition="'$(__ProjectDir)'==''">$(MSBuildThisFileDirectory)</ProjectDir>

<BaseIntermediateOutputPath>$(RootRepoDir)artifacts\obj\llvm\$(MSBuildProjectName)\</BaseIntermediateOutputPath>

<SourceDir>$(__SourceDir)\</SourceDir>
<SourceDir Condition="'$(__SourceDir)'==''">$(ProjectDir)src\</SourceDir>

<RootBinDir>$(__RootBinDir)\</RootBinDir>
<RootBinDir Condition="'$(__RootBinDir)'==''">$(RootRepoDir)artifacts\</RootBinDir>

<BinDir>$(__BinDir)\</BinDir>
<BinDir Condition="'$(__BinDir)'==''">$(RootBinDir)bin\llvm\$(PlatformConfigPathPart)\</BinDir>

<_LLVMSourceDir Condition="'$(_LLVMSourceDir)'==''">$(MSBuildThisFileDirectory)/llvm</_LLVMSourceDir>
<_LLVMBuildDir Condition="'$(_LLVMBuildDir)'==''">$(MSBuildThisFileDirectory)/artifacts/obj/BuildRoot-$(TargetArchitecture)</_LLVMBuildDir>
<_LLVMInstallDir Condition="'$(_LLVMInstallDir)'==''">$(MSBuildThisFileDirectory)/artifacts/obj/InstallRoot-$(TargetArchitecture)</_LLVMInstallDir>

<_LibCxxSourceDir Condition="'$(_LibCxxSourceDir)'==''">$(MSBuildThisFileDirectory)/runtimes</_LibCxxSourceDir>
<_LibCxxBuildDir Condition="'$(_LibCxxBuildDir)'==''">$(MSBuildThisFileDirectory)/artifacts/obj/libcxx/BuildRoot-$(TargetArchitecture)</_LibCxxBuildDir>
<_LibCxxInstallDir Condition="'$(_LibCxxInstallDir)'==''">$(MSBuildThisFileDirectory)/artifacts/obj/libcxx/InstallRoot-$(TargetArchitecture)</_LibCxxInstallDir>

</PropertyGroup>

<PropertyGroup>
<!-- Central place to set the versions of all nuget packages produced in the repo -->
<LLVMVersion Condition="'$(LLVMVersion)' == '' AND !Exists('$(_LLVMBuildDir)\version.txt')">1.0.0</LLVMVersion>
<LLVMVersion Condition="'$(LLVMVersion)' == '' AND Exists('$(_LLVMBuildDir)\version.txt')">$([System.IO.File]::ReadAllText('$(_LLVMBuildDir)\version.txt'))</LLVMVersion>
<PackageVersion Condition="'$(LLVMVersion)' != '' and '$(PackageVersion)' == ''">$(LLVMVersion)</PackageVersion>

<!-- Set the boolean below to true to generate packages with stabilized versions -->
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
<StableVersion Condition="'$(StabilizePackageVersion)' == 'true' and '$(StableVersion)' == ''">$(PackageVersion)</StableVersion>

<PreReleaseLabel>preview8</PreReleaseLabel>
</PropertyGroup>

<!-- Set up common target properties that we use to conditionally include sources -->
<PropertyGroup>
<TargetsFreeBSD Condition="'$(BuildOS)' == 'FreeBSD'">true</TargetsFreeBSD>
<TargetsLinux Condition="'$(BuildOS)' == 'Linux'">true</TargetsLinux>
<TargetsNetBSD Condition="'$(BuildOS)' == 'NetBSD'">true</TargetsNetBSD>
<TargetsOSX Condition="'$(BuildOS)' == 'OSX'">true</TargetsOSX>
<TargetsWindows Condition="'$(BuildOS)' == 'Windows_NT'">true</TargetsWindows>

<TargetsUnix Condition="'$(TargetsFreeBSD)' == 'true' or '$(TargetsLinux)' == 'true' or '$(TargetsNetBSD)' == 'true' or '$(TargetsOSX)' == 'true'">true</TargetsUnix>

</PropertyGroup>

</Project>
6 changes: 6 additions & 0 deletions eng/Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ProjectToBuild Include="$(MSBuildThisFileDirectory)..\llvm.proj" />
</ItemGroup>
</Project>
Loading