[libc] Remove direct math.h includes (#85324)

Reland of #84991

A downstream overlay mode user ran into issues with the isnan macro not
working in our sources with a specific libc configuration. This patch
replaces the last direct includes of math.h with our internal
math_macros.h, along with the necessary build system changes.
This commit is contained in:
Michael Jones
2024-03-18 14:19:33 -07:00
committed by GitHub
parent d0d9839b14
commit 5d56b34807
129 changed files with 166 additions and 149 deletions

View File

@@ -1,7 +1,8 @@
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer")
add_custom_target(libc-fuzzer)
add_subdirectory(math)
# TODO(#85680): Re-enable math fuzzing after headers are sorted out
# add_subdirectory(math)
add_subdirectory(stdlib)
add_subdirectory(stdio)
add_subdirectory(string)

View File

@@ -11,7 +11,7 @@
#include "src/__support/FPUtil/FPBits.h"
#include <math.h>
#include "include/llvm-libc-macros/math-macros.h"
#include <stddef.h>
#include <stdint.h>

View File

@@ -10,9 +10,7 @@
#define LLVM_LIBC_FUZZING_MATH_SINGLE_INPUT_SINGLE_OUTPUT_DIFF_H
#include "fuzzing/math/Compare.h"
#include "src/__support/FPUtil/FPBits.h"
#include <math.h>
#include <stddef.h>
#include <stdint.h>

View File

@@ -10,9 +10,7 @@
#define LLVM_LIBC_FUZZING_MATH_TWO_INPUT_SINGLE_OUTPUT_DIFF_H
#include "fuzzing/math/Compare.h"
#include "src/__support/FPUtil/FPBits.h"
#include <math.h>
#include <stddef.h>
#include <stdint.h>

View File

@@ -16,7 +16,7 @@
#include "src/__support/FPUtil/FPBits.h"
#include <math.h>
#include "include/llvm-libc-macros/math-macros.h"
#include <stddef.h>
#include <stdint.h>