ABI and API compatibility — libgccjit 16.0.0 (experimental ) documentation (original) (raw)
The libgccjit developers strive for ABI and API backward-compatibility: programs built against libgccjit.so stand a good chance of running without recompilation against newer versions of libgccjit.so, and ought to recompile without modification against newer versions of libgccjit.h.
API compatibility is achieved by extending the API rather than changing it. For ABI compatiblity, we avoid bumping the SONAME, and instead use symbol versioning to tag each symbol, so that a binary linked against libgccjit.so is tagged according to the symbols that it uses.
For example, gcc_jit_context_add_command_line_option() was added inLIBGCCJIT_ABI_1
. If a client program uses it, this can be detected from metadata by using objdump
:
ABI symbol tags¶
The initial release of libgccjit (in gcc 5.1) did not use symbol versioning.
Newer releases use the following tags.
LIBGCCJIT_ABI_0
¶
All entrypoints in the initial release of libgccjit are tagged withLIBGCCJIT_ABI_0
, to signify the transition to symbol versioning.
Binaries built against older copies of libgccjit.so
should continue to work, with this being handled transparently by the linker (see this post)
LIBGCCJIT_ABI_1
¶
LIBGCCJIT_ABI_1
covers the addition ofgcc_jit_context_add_command_line_option()
LIBGCCJIT_ABI_2
¶
LIBGCCJIT_ABI_2
covers the addition ofgcc_jit_context_set_bool_allow_unreachable_blocks()
LIBGCCJIT_ABI_3
¶
LIBGCCJIT_ABI_3
covers the addition of switch statements via API entrypoints:
- gcc_jit_block_end_with_switch()
gcc_jit_case_as_object()
gcc_jit_context_new_case()
LIBGCCJIT_ABI_4
¶
LIBGCCJIT_ABI_4
covers the addition of timers via API entrypoints:
LIBGCCJIT_ABI_5
¶
LIBGCCJIT_ABI_5
covers the addition ofgcc_jit_context_set_bool_use_external_driver()
LIBGCCJIT_ABI_6
¶
LIBGCCJIT_ABI_6
covers the addition ofgcc_jit_rvalue_set_bool_require_tail_call()
LIBGCCJIT_ABI_7
¶
LIBGCCJIT_ABI_7
covers the addition ofgcc_jit_type_get_aligned()
LIBGCCJIT_ABI_8
¶
LIBGCCJIT_ABI_8
covers the addition ofgcc_jit_type_get_vector()
LIBGCCJIT_ABI_9
¶
LIBGCCJIT_ABI_9
covers the addition ofgcc_jit_function_get_address()
LIBGCCJIT_ABI_10
¶
LIBGCCJIT_ABI_10
covers the addition ofgcc_jit_context_new_rvalue_from_vector()
LIBGCCJIT_ABI_11
¶
LIBGCCJIT_ABI_11
covers the addition ofgcc_jit_context_add_driver_option()
LIBGCCJIT_ABI_12
¶
LIBGCCJIT_ABI_12
covers the addition ofgcc_jit_context_new_bitfield()
LIBGCCJIT_ABI_13
¶
LIBGCCJIT_ABI_13
covers the addition of version functions via API entrypoints:
LIBGCCJIT_ABI_14
¶
LIBGCCJIT_ABI_14
covers the addition ofgcc_jit_global_set_initializer()
LIBGCCJIT_ABI_15
¶
LIBGCCJIT_ABI_15
covers the addition of API entrypoints for directly embedding assembler instructions:
- gcc_jit_block_add_extended_asm()
- gcc_jit_block_end_with_extended_asm_goto()
- gcc_jit_extended_asm_as_object()
- gcc_jit_extended_asm_set_volatile_flag()
- gcc_jit_extended_asm_set_inline_flag()
- gcc_jit_extended_asm_add_output_operand()
- gcc_jit_extended_asm_add_input_operand()
- gcc_jit_extended_asm_add_clobber()
- gcc_jit_context_add_top_level_asm()
LIBGCCJIT_ABI_16
¶
LIBGCCJIT_ABI_16
covers the addition of reflection functions via API entrypoints:
- gcc_jit_function_get_return_type()
- gcc_jit_function_get_param_count()
- gcc_jit_type_dyncast_array()
- gcc_jit_type_is_bool()
- gcc_jit_type_is_integral()
- gcc_jit_type_is_pointer()
- gcc_jit_type_is_struct()
- gcc_jit_type_dyncast_vector()
- gcc_jit_type_unqualified()
- gcc_jit_type_dyncast_function_ptr_type()
- gcc_jit_function_type_get_return_type()
- gcc_jit_function_type_get_param_count()
- gcc_jit_function_type_get_param_type()
- gcc_jit_vector_type_get_num_units()
- gcc_jit_vector_type_get_element_type()
- gcc_jit_struct_get_field()
- gcc_jit_struct_get_field_count()
LIBGCCJIT_ABI_17
¶
LIBGCCJIT_ABI_17
covers the addition of an API entrypoint to set the thread-local storage model of a variable:
LIBGCCJIT_ABI_18
¶
LIBGCCJIT_ABI_18
covers the addition of an API entrypoint to set the link section of a variable:
LIBGCCJIT_ABI_19
¶
LIBGCCJIT_ABI_19
covers the addition of API entrypoints to set the initial value of a global with an rvalue and to use constructors:
LIBGCCJIT_ABI_20
¶
LIBGCCJIT_ABI_20
covers the addition of sized integer types, including 128-bit integers and helper functions for types:
- gcc_jit_compatible_types()
- gcc_jit_type_get_size()
GCC_JIT_TYPE_UINT8_T
GCC_JIT_TYPE_UINT16_T
GCC_JIT_TYPE_UINT32_T
GCC_JIT_TYPE_UINT64_T
GCC_JIT_TYPE_UINT128_T
GCC_JIT_TYPE_INT8_T
GCC_JIT_TYPE_INT16_T
GCC_JIT_TYPE_INT32_T
GCC_JIT_TYPE_INT64_T
GCC_JIT_TYPE_INT128_T
LIBGCCJIT_ABI_21
¶
LIBGCCJIT_ABI_21
covers the addition of an API entrypoint to bitcast a value from one type to another:
LIBGCCJIT_ABI_22
¶
LIBGCCJIT_ABI_22
covers the addition of an API entrypoint to set the register name of a variable:
LIBGCCJIT_ABI_23
¶
LIBGCCJIT_ABI_23
covers the addition of an API entrypoint to hide stderr logs:
LIBGCCJIT_ABI_24
¶
LIBGCCJIT_ABI_24
covers the addition of functions to get and set the alignment of a variable:
LIBGCCJIT_ABI_25
¶
LIBGCCJIT_ABI_25
covers the addition ofgcc_jit_type_get_restrict()
LIBGCCJIT_ABI_26
¶
LIBGCCJIT_ABI_26
covers the addition of functions to set attributes on functions and variables:
gcc_jit_function_add_attribute()
gcc_jit_function_add_string_attribute()
gcc_jit_function_add_integer_array_attribute()
gcc_jit_lvalue_add_string_attribute()
LIBGCCJIT_ABI_27
¶
LIBGCCJIT_ABI_27
covers the addition ofgcc_jit_context_new_sizeof()
LIBGCCJIT_ABI_28
¶
LIBGCCJIT_ABI_28
covers the addition ofgcc_jit_context_new_alignof()
LIBGCCJIT_ABI_29
¶
LIBGCCJIT_ABI_29
covers the addition ofgcc_jit_global_set_readonly()
LIBGCCJIT_ABI_30
¶
LIBGCCJIT_ABI_30
covers the addition ofgcc_jit_context_convert_vector()
LIBGCCJIT_ABI_31
¶
LIBGCCJIT_ABI_31
covers the addition of functions to manipulate vectors:
LIBGCCJIT_ABI_32
¶
LIBGCCJIT_ABI_32
covers the addition of a function to get target builtins:
LIBGCCJIT_ABI_33
¶
LIBGCCJIT_ABI_33
covers the addition of a function to create a new temporary variable:
LIBGCCJIT_ABI_34
¶
LIBGCCJIT_ABI_34
covers the addition of