CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
34 lines
1.7 KiB
C++
34 lines
1.7 KiB
C++
//===-- Implementation of _start for x86_64 -------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
#include "src/__support/macros/attributes.h"
|
|
#include "startup/linux/do_start.h"
|
|
|
|
extern "C" [[noreturn]] void _start() {
|
|
// This TU is compiled with -fno-omit-frame-pointer. Hence, the previous
|
|
// value of the base pointer is pushed on to the stack. So, we step over
|
|
// it (the "+ 1" below) to get to the args.
|
|
LIBC_NAMESPACE::app.args = reinterpret_cast<LIBC_NAMESPACE::Args *>(
|
|
reinterpret_cast<uintptr_t *>(__builtin_frame_address(0)) + 1);
|
|
|
|
// The x86_64 ABI requires that the stack pointer is aligned to a 16-byte
|
|
// boundary. We align it here but we cannot use any local variables created
|
|
// before the following alignment. Best would be to not create any local
|
|
// variables before the alignment. Also, note that we are aligning the stack
|
|
// downwards as the x86_64 stack grows downwards. This ensures that we don't
|
|
// tread on argc, argv etc.
|
|
// NOTE: Compiler attributes for alignment do not help here as the stack
|
|
// pointer on entry to this _start function is controlled by the OS. In fact,
|
|
// compilers can generate code assuming the alignment as required by the ABI.
|
|
// If the stack pointers as setup by the OS are already aligned, then the
|
|
// following code is a NOP.
|
|
asm volatile("andq $0xfffffffffffffff0, %rsp\n\t");
|
|
asm volatile("andq $0xfffffffffffffff0, %rbp\n\t");
|
|
|
|
LIBC_NAMESPACE::do_start();
|
|
}
|