Get codebase completely working with LLVM
You can now build Cosmopolitan with Clang:
make -j8 MODE=llvm
o/llvm/examples/hello.com
The assembler and linker code is now friendly to LLVM too.
So it's not needed to configure Clang to use binutils under
the hood. If you love LLVM then you can now use pure LLVM.
This commit is contained in:
@ -16,6 +16,7 @@
|
||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/sock/internal.h"
|
||||
@ -41,8 +42,7 @@ int bind(int fd, const void *addr, uint32_t addrsize) {
|
||||
return sys_bind(fd, addr, addrsize);
|
||||
} else {
|
||||
struct sockaddr_in_bsd addr2;
|
||||
_Static_assert(sizeof(struct sockaddr_in) ==
|
||||
sizeof(struct sockaddr_in_bsd));
|
||||
assert(sizeof(struct sockaddr_in) == sizeof(struct sockaddr_in_bsd));
|
||||
memcpy(&addr2, addr, sizeof(struct sockaddr_in));
|
||||
sockaddr2bsd(&addr2);
|
||||
return sys_bind(fd, &addr2, addrsize);
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/sock/internal.h"
|
||||
#include "libc/str/str.h"
|
||||
@ -27,8 +28,7 @@ int sys_connect(int fd, const void *addr, uint32_t addrsize) {
|
||||
return __sys_connect(fd, addr, addrsize);
|
||||
} else {
|
||||
struct sockaddr_in_bsd addr2;
|
||||
_Static_assert(sizeof(struct sockaddr_in) ==
|
||||
sizeof(struct sockaddr_in_bsd));
|
||||
assert(sizeof(struct sockaddr_in) == sizeof(struct sockaddr_in_bsd));
|
||||
memcpy(&addr2, addr, sizeof(struct sockaddr_in));
|
||||
sockaddr2bsd(&addr2);
|
||||
return sys_connect(fd, &addr2, addrsize);
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/calls/internal.h"
|
||||
#include "libc/calls/struct/iovec.h"
|
||||
#include "libc/dce.h"
|
||||
@ -46,7 +47,7 @@
|
||||
*/
|
||||
ssize_t sendto(int fd, const void *buf, size_t size, uint32_t flags,
|
||||
const void *opt_addr, uint32_t addrsize) {
|
||||
_Static_assert(sizeof(struct sockaddr_in) == sizeof(struct sockaddr_in_bsd));
|
||||
assert(sizeof(struct sockaddr_in) == sizeof(struct sockaddr_in_bsd));
|
||||
if (!IsWindows()) {
|
||||
if (!IsBsd() || !opt_addr) {
|
||||
return sys_sendto(fd, buf, size, flags, opt_addr, addrsize);
|
||||
|
||||
Reference in New Issue
Block a user