mirror of
https://github.com/darlinghq/darling.git
synced 2026-04-24 13:08:35 -05:00
Fix mig to produce output as on macOS (alignment / natural_t size problem)
This commit is contained in:
+2
-2
@@ -39,7 +39,7 @@ function(mig defFileName)
|
||||
# set (MIG_ARCH "${arch}")
|
||||
#endif(NOT arch)
|
||||
if (NOT MIG_ARCH)
|
||||
set(MIG_ARCH "x86-64")
|
||||
set(MIG_ARCH "i386")
|
||||
endif (NOT MIG_ARCH)
|
||||
|
||||
add_custom_command(OUTPUT
|
||||
@@ -58,6 +58,6 @@ function(mig defFileName)
|
||||
${MIG_FLAGS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${defFileName}
|
||||
DEPENDS
|
||||
migcom
|
||||
migexe
|
||||
)
|
||||
endfunction(mig)
|
||||
|
||||
@@ -6,7 +6,7 @@ find_package(BISON)
|
||||
find_package(FLEX)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
|
||||
add_definitions(-Du_int=unsigned -D__int64_t=int64_t -D__int32_t=int32_t -D__darwin_natural_t=long -D__uint32_t=uint32_t -D__uint16_t=uint16_t -D__uint64_t=uint64_t -D_BSD_I386__TYPES_H_)
|
||||
add_definitions(-Du_int=unsigned -D__int64_t=int64_t -D__int32_t=int32_t -D__darwin_natural_t=unsigned -D__uint32_t=uint32_t -D__uint16_t=uint16_t -D__uint64_t=uint64_t -D_BSD_I386__TYPES_H_)
|
||||
add_definitions('-DMIG_VERSION="1.0"')
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/mach)
|
||||
@@ -39,10 +39,10 @@ set(mig_sources
|
||||
add_executable(migcom ${mig_sources})
|
||||
|
||||
add_custom_command(
|
||||
TARGET migcom
|
||||
POST_BUILD
|
||||
#TARGET migcom
|
||||
#POST_BUILD
|
||||
#DEPENDS migcom
|
||||
#OUTPUT "${CMAKE_BINARY_DIR}/mig"
|
||||
OUTPUT "${CMAKE_BINARY_DIR}/mig"
|
||||
COMMAND
|
||||
awk -v "migcc=${CMAKE_C_COMPILER}"
|
||||
-v "migcom=${CMAKE_CURRENT_BINARY_DIR}/migcom"
|
||||
@@ -50,5 +50,8 @@ add_custom_command(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/migcom.tproj/mig.sh" ">${CMAKE_BINARY_DIR}/mig"
|
||||
&& chmod 0755 "${CMAKE_BINARY_DIR}/mig"
|
||||
)
|
||||
add_custom_target(migexe DEPENDS "${CMAKE_BINARY_DIR}/mig")
|
||||
|
||||
add_dependencies(migexe migcom)
|
||||
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ do
|
||||
fi
|
||||
rm -f "${temp}.c" "${temp}.d"
|
||||
(echo '#line 1 '\"${file}\" ; cat "${file}" ) > "${temp}.c"
|
||||
"$C" -E -arch ${arch} "${cppflags[@]}" -I "${sourcedir}" "${iSysRootParm[@]}" "${temp}.c" | "$M" "${migflags[@]}"
|
||||
"$C" -E -target ${arch} "${cppflags[@]}" -I "${sourcedir}" "${iSysRootParm[@]}" "${temp}.c" | "$M" "${migflags[@]}"
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
rm -rf "${temp}.c" "${temp}.d" "${WORKTMP}"
|
||||
|
||||
@@ -734,6 +734,7 @@ init_type(void)
|
||||
}
|
||||
else
|
||||
error("init_type unknown size %d", size);
|
||||
printf("Integer size is %d\n", size);
|
||||
|
||||
machine_integer_bits = size;
|
||||
|
||||
@@ -882,7 +883,7 @@ itCheckIntType(identifier_t name, ipc_type_t *it)
|
||||
!it->itInLine ||
|
||||
!it->itStruct ||
|
||||
it->itVarArray)
|
||||
error("argument %s isn't a proper integer", name);
|
||||
error("argument %s isn't a proper integer, size=%d", name, it->itSize);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user