Skip to content

Commit

Permalink
toolchain: Use LTO with clang
Browse files Browse the repository at this point in the history
  • Loading branch information
marv7000 committed Jan 1, 2025
1 parent bc7d6b3 commit 5c1de3b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion modules/drv/gpu/drm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

add_module(udrm "Marvin Friedrich" "Direct Rendering Manager" MAIN OFF ON
udrm_bridge.c
udrm/src/udrm_core.c
udrm/src/udrm.c
udrm/src/udrm_bochs.c
)
target_include_directories(${MENIX_CURRENT_MOD} PRIVATE udrm/include)
28 changes: 24 additions & 4 deletions modules/drv/gpu/drm/udrm_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@
#include <udrm/kernel_api.h>
#include <udrm/udrm.h>

// Bochs GPU
#include <udrm/bochs.h>

static i32 bochs_probe(PciDevice* dev)
{
uapi_status status = udrm_bochs_probe(dev);
return status;
return udrm_bochs_probe(dev);
}

static void bochs_remove(PciDevice* dev)
{
udrm_bochs_remove(dev);
}

static PciVariant bochs_variant = {
Expand All @@ -24,14 +31,27 @@ static PciDriver bochs_driver = {
.variants = &bochs_variant,
.num_variants = 1,
.probe = bochs_probe,
.remove = bochs_remove,
};

static i32 init_fn()
{
udrm_initialize();
uapi_status status = udrm_initialize();
if (status != UAPI_STATUS_OK)
{
print_error("uDRM has failed to initialize!\n");
return status;
}

// Register all device drivers.
pci_register_driver(&bochs_driver);
i32 pci_status;

pci_status = pci_register_driver(&bochs_driver);
if (pci_status != 0)
{
print_error("Failed to register the Bochs PCI driver.\n");
return pci_status;
}

return 0;
}
Expand Down
6 changes: 5 additions & 1 deletion toolchain/compiler/Clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
target_compile_options(common INTERFACE
-Wno-unused-command-line-argument
-no-integrated-as
)
)

target_compile_options(common_kernel INTERFACE
-flto
)

0 comments on commit 5c1de3b

Please sign in to comment.