mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-12 14:09:12 +00:00
Get GCC to mostly build with Cosmo
This commit is contained in:
parent
2eb7148474
commit
9b55dbe417
54 changed files with 113 additions and 132 deletions
2
third_party/getopt/getopt.h
vendored
2
third_party/getopt/getopt.h
vendored
|
@ -1,5 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_GETOPT_GETOPT_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_GETOPT_GETOPT_H_
|
||||
#ifdef COSMO
|
||||
|
||||
#define no_argument 0
|
||||
#define required_argument 1
|
||||
|
@ -27,4 +28,5 @@ int getopt_long_only(int, char *const *, const char *, const struct option *,
|
|||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMO */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_GETOPT_GETOPT_H_ */
|
||||
|
|
6
third_party/mbedtls/sha256.c
vendored
6
third_party/mbedtls/sha256.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "third_party/mbedtls/sha256.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/macros.internal.h"
|
||||
|
@ -26,7 +27,6 @@
|
|||
#include "third_party/mbedtls/endian.h"
|
||||
#include "third_party/mbedtls/error.h"
|
||||
#include "third_party/mbedtls/md.h"
|
||||
#include "third_party/mbedtls/sha256.h"
|
||||
|
||||
asm(".ident\t\"\\n\\n\
|
||||
Mbed TLS (Apache 2.0)\\n\
|
||||
|
@ -476,12 +476,12 @@ exit:
|
|||
return( ret );
|
||||
}
|
||||
|
||||
noinstrument int mbedtls_sha256_ret_224( const void *input, size_t ilen, unsigned char *output )
|
||||
dontinstrument int mbedtls_sha256_ret_224( const void *input, size_t ilen, unsigned char *output )
|
||||
{
|
||||
return mbedtls_sha256_ret( input, ilen, output, true );
|
||||
}
|
||||
|
||||
noinstrument int mbedtls_sha256_ret_256( const void *input, size_t ilen, unsigned char *output )
|
||||
dontinstrument int mbedtls_sha256_ret_256( const void *input, size_t ilen, unsigned char *output )
|
||||
{
|
||||
return mbedtls_sha256_ret( input, ilen, output, false );
|
||||
}
|
||||
|
|
6
third_party/mbedtls/sha512.c
vendored
6
third_party/mbedtls/sha512.c
vendored
|
@ -15,6 +15,7 @@
|
|||
│ See the License for the specific language governing permissions and │
|
||||
│ limitations under the License. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "third_party/mbedtls/sha512.h"
|
||||
#include "libc/intrin/asan.internal.h"
|
||||
#include "libc/literal.h"
|
||||
#include "libc/macros.internal.h"
|
||||
|
@ -27,7 +28,6 @@
|
|||
#include "third_party/mbedtls/error.h"
|
||||
#include "third_party/mbedtls/md.h"
|
||||
#include "third_party/mbedtls/platform.h"
|
||||
#include "third_party/mbedtls/sha512.h"
|
||||
|
||||
asm(".ident\t\"\\n\\n\
|
||||
Mbed TLS (Apache 2.0)\\n\
|
||||
|
@ -419,12 +419,12 @@ cleanup:
|
|||
return( ret );
|
||||
}
|
||||
|
||||
noinstrument int mbedtls_sha512_ret_384( const void *input, size_t ilen, unsigned char *output )
|
||||
dontinstrument int mbedtls_sha512_ret_384( const void *input, size_t ilen, unsigned char *output )
|
||||
{
|
||||
return mbedtls_sha512_ret( input, ilen, output, true );
|
||||
}
|
||||
|
||||
noinstrument int mbedtls_sha512_ret_512( const void *input, size_t ilen, unsigned char *output )
|
||||
dontinstrument int mbedtls_sha512_ret_512( const void *input, size_t ilen, unsigned char *output )
|
||||
{
|
||||
return mbedtls_sha512_ret( input, ilen, output, false );
|
||||
}
|
||||
|
|
4
third_party/puff/puff.c
vendored
4
third_party/puff/puff.c
vendored
|
@ -22,8 +22,8 @@
|
|||
│ │
|
||||
│ Mark Adler madler@alumni.caltech.edu │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "third_party/puff/puff.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
// clang-format off
|
||||
|
||||
asm(".ident\t\"\\n\\n\
|
||||
|
@ -158,7 +158,7 @@ struct state {
|
|||
* buffer, using shift right, and new bytes are appended to the top of the
|
||||
* bit buffer, using shift left.
|
||||
*/
|
||||
local noinstrument int bits(struct state *s, int need)
|
||||
local dontinstrument int bits(struct state *s, int need)
|
||||
{
|
||||
long val; /* bit accumulator (can use up to 20 bits) */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue