Skip to content

Commit

Permalink
Allow correct compilation with Clang/LLVM
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus Köhler <khler.marcus@gmail.com>
  • Loading branch information
B4ckslash authored and gnif committed Apr 16, 2024
1 parent f72619e commit 084881c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ static bool hook_installed = false;
static int (*orig_pci_dev_specific_reset)(struct pci_dev *dev, int probe);

/* TCO breaks the hook, we must disable it for this function */
#if defined(__GNUC__) && !defined(__llvm__)
__attribute__((optimize("-fno-optimize-sibling-calls")))
#elif defined(__clang__)
__attribute__((disable_tail_calls))
#endif
static int hooked_pci_dev_specific_reset(struct pci_dev *dev, int probe)
{
int ret;
Expand Down

0 comments on commit 084881c

Please sign in to comment.