ANDROID: Clang LTO: Only set -fvisibility=hidden for x86

Otherwise this upsets ABI monitoring.

Leaf changes summary: 2689 artifacts changed
Changed leaf types summary: 16 leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 2472 Changed, 136 Added functions
Removed/Changed/Added variables summary: 0 Removed, 47 Changed, 18 Added variables

136 Added functions:

  [A] 'function int ___pskb_trim(sk_buff*, unsigned int)'
  [A] 'function void __cfi_slowpath(uint64_t, void*, void*)'
  [A] 'function void __dynamic_dev_dbg(_ddebug*, const device*, const char*, ...)'
  [A] 'function void __dynamic_pr_debug(_ddebug*, const char*, ...)'
  [A] 'function ktime_t __hrtimer_get_remaining(const hrtimer*, bool)'
  [A] 'function zoneref* __next_zones_zonelist(zoneref*, zone_type, nodemask_t*)'
  [A] 'function int __nla_validate(const nlattr*, int, int, const nla_policy*, unsigned int, netlink_ext_ack*)'
  [A] 'function void __skb_get_hash(sk_buff*)'
  [A] 'function sk_buff* __skb_gso_segment(sk_buff*, netdev_features_t, bool)'
  [A] 'function int __trace_bputs(unsigned long int, const char*)'
  [A] 'function int __trace_printk(unsigned long int, const char*, ...)'
  [A] 'function int _raw_spin_trylock_bh(raw_spinlock_t*)'
  [A] 'function int add_memory_subsection(int, u64, u64)'
  [A] 'function int alarm_cancel(alarm*)'
  [A] 'function void alarm_init(alarm*, alarmtimer_type, enum alarmtimer_restart (alarm*, typedef ktime_t)*)'
  [A] 'function void alarm_start_relative(alarm*, ktime_t)'
  [A] 'function int bgpio_init(gpio_chip*, device*, unsigned long int, void*, void*, void*, void*, void*, unsigned long int)'
  [A] 'function int bitmap_parselist(const char*, unsigned long int*, int)'
  [A] 'function int bitmap_parselist_user(const char*, unsigned int, unsigned long int*, int)'
  [A] 'function void bt_err(const char*, ...)'
  [A] 'function int cgroup_path_ns(cgroup*, char*, size_t, cgroup_namespace*)'
  [A] 'function void clk_hw_set_rate_range(clk_hw*, unsigned long int, unsigned long int)'
  [A] 'function unsigned int cpufreq_quick_get(unsigned int)'
  [A] 'function s64 cpuidle_governor_latency_req(unsigned int)'
  [A] 'function int cpuidle_register_governor(cpuidle_governor*)'
  [A] 'function int cpupri_find_fitness(cpupri*, task_struct*, cpumask*, typedef bool (task_struct*, int)*)'
  [A] 'function __sum16 csum_ipv6_magic(const in6_addr*, const in6_addr*, __u32, __u8, __wsum)'
  [A] 'function __wsum csum_partial(void*, int, __wsum)'
  [A] 'function dentry* debugfs_create_blob(const char*, umode_t, dentry*, debugfs_blob_wrapper*)'
  [A] 'function dentry* debugfs_create_symlink(const char*, dentry*, const char*)'
  [A] 'function int dev_pm_genpd_remove_notifier(device*)'
  [A] 'function int dev_pm_genpd_set_next_wakeup(device*, ktime_t)'
  [A] 'function int dev_pm_opp_register_notifier(device*, notifier_block*)'
  [A] 'function int dev_pm_opp_unregister_notifier(device*, notifier_block*)'
  [A] 'function int devfreq_add_governor(devfreq_governor*)'
  [A] 'function int devfreq_remove_governor(devfreq_governor*)'
  [A] 'function void device_remove_groups(device*, const attribute_group**)'
  [A] 'function ssize_t device_show_int(device*, device_attribute*, char*)'
  [A] 'function ssize_t device_store_int(device*, device_attribute*, const char*, size_t)'
  [A] 'function backlight_device* devm_backlight_device_register(device*, const char*, device*, void*, const backlight_ops*, const backlight_properties*)'
  [A] 'function int devm_blk_ksm_init(device*, blk_keyslot_manager*, unsigned int)'
  [A] 'function void devm_extcon_dev_unregister(device*, extcon_dev*)'
  [A] 'function usb_phy* devm_usb_get_phy_by_node(device*, device_node*, notifier_block*)'
  [A] 'function bool drm_edid_is_valid(edid*)'
  [A] 'function bool drm_mode_is_420_only(const drm_display_info*, const drm_display_mode*)'
  [A] 'function pid* find_get_pid(pid_t)'
  [A] 'function task_struct* find_task_by_vpid(pid_t)'
  [A] 'function const char* fwnode_get_name(const fwnode_handle*)'
  [A] 'function fwnode_handle* fwnode_get_named_child_node(const fwnode_handle*, const char*)'
  [A] 'function pid* get_task_pid(task_struct*, pid_type)'
  [A] 'function unsigned long int get_unmapped_area(file*, unsigned long int, unsigned long int, unsigned long int, unsigned long int)'
  [A] 'function void getboottime64(timespec64*)'
  [A] 'function zone_type gfp_zone(gfp_t)'
  [A] 'function void gro_cells_destroy(gro_cells*)'
  [A] 'function int gro_cells_init(gro_cells*, net_device*)'
  [A] 'function int gro_cells_receive(gro_cells*, sk_buff*)'
  [A] 'function hci_dev* hci_alloc_dev()'
  [A] 'function void hci_free_dev(hci_dev*)'
  [A] 'function int hci_recv_frame(hci_dev*, sk_buff*)'
  [A] 'function int hci_register_dev(hci_dev*)'
  [A] 'function void hci_unregister_dev(hci_dev*)'
  [A] 'function bool hrtimer_active(const hrtimer*)'
  [A] 'function i2c_client* i2c_new_scanned_device(i2c_adapter*, i2c_board_info*, const unsigned short int*, int (i2c_adapter*, unsigned short int)*)'
  [A] 'function i2c_adapter* i2c_verify_adapter(device*)'
  [A] 'function int input_mt_assign_slots(input_dev*, int*, const input_mt_pos*, int, int)'
  [A] 'function void input_mt_drop_unused(input_dev*)'
  [A] 'function void input_mt_report_finger_count(input_dev*, int)'
  [A] 'function void input_mt_sync_frame(input_dev*)'
  [A] 'function unsigned long int int_sqrt(unsigned long int)'
  [A] 'function int iommu_attach_group(iommu_domain*, iommu_group*)'
  [A] 'function void iommu_detach_group(iommu_domain*, iommu_group*)'
  [A] 'function int iommu_get_msi_cookie(iommu_domain*, dma_addr_t)'
  [A] 'function phys_addr_t iommu_iova_to_phys(iommu_domain*, dma_addr_t)'
  [A] 'function __sum16 ip_compute_csum(void*, int)'
  [A] 'function bool ipv6_ext_hdr(u8)'
  [A] 'function int ipv6_skip_exthdr(const sk_buff*, int, u8*, __be16*)'
  [A] 'function int kstrtoull_from_user(const char*, size_t, unsigned int, long long unsigned int*)'
  [A] 'function llist_node* llist_reverse_order(llist_node*)'
  [A] 'function nlattr* nla_find(const nlattr*, int, int)'
  [A] 'function nlattr* nla_reserve(sk_buff*, int, int)'
  [A] 'function nlattr* nla_reserve_64bit(sk_buff*, int, int, int)'
  [A] 'function int nvmem_cell_read_u32(device*, const char*, u32*)'
  [A] 'function thermal_cooling_device* of_devfreq_cooling_register(device_node*, devfreq*)'
  [A] 'function device_node* of_find_node_by_phandle(phandle)'
  [A] 'function bool of_graph_is_present(const device_node*)'
  [A] 'function int of_platform_device_destroy(device*, void*)'
  [A] 'function int of_property_read_variable_u16_array(const device_node*, const char*, u16*, size_t, size_t)'
  [A] 'function int param_get_ullong(char*, const kernel_param*)'
  [A] 'function task_struct* pick_highest_pushable_task(rq*, int)'
  [A] 'function pid_t pid_nr_ns(pid*, pid_namespace*)'
  [A] 'function void proc_remove(proc_dir_entry*)'
  [A] 'function void proc_set_user(proc_dir_entry*, kuid_t, kgid_t)'
  [A] 'function void ps2_begin_command(ps2dev*)'
  [A] 'function void ps2_cmd_aborted(ps2dev*)'
  [A] 'function int ps2_command(ps2dev*, u8*, unsigned int)'
  [A] 'function void ps2_drain(ps2dev*, size_t, unsigned int)'
  [A] 'function void ps2_end_command(ps2dev*)'
  [A] 'function bool ps2_handle_ack(ps2dev*, u8)'
  [A] 'function bool ps2_handle_response(ps2dev*, u8)'
  [A] 'function void ps2_init(ps2dev*, serio*)'
  [A] 'function int ps2_sendbyte(ps2dev*, u8, unsigned int)'
  [A] 'function int ps2_sliced_command(ps2dev*, u8)'
  [A] 'function void qdisc_reset(Qdisc*)'
  [A] 'function rb_node* rb_last(const rb_root*)'
  [A] 'function int remove_memory_subsection(int, u64, u64)'
  [A] 'function int scsi_device_quiesce(scsi_device*)'
  [A] 'function void scsi_remove_device(scsi_device*)'
  [A] 'function void serio_rescan(serio*)'
  [A] 'function void serio_unregister_child_port(serio*)'
  [A] 'function void show_regs(pt_regs*)'
  [A] 'function void si_meminfo(sysinfo*)'
  [A] 'function void si_swapinfo(sysinfo*)'
  [A] 'function int skb_append_pagefrags(sk_buff*, page*, int, size_t)'
  [A] 'function __wsum skb_checksum(const sk_buff*, int, int, __wsum)'
  [A] 'function void snd_pcm_stream_lock(snd_pcm_substream*)'
  [A] 'function void snd_pcm_stream_unlock(snd_pcm_substream*)'
  [A] 'function void static_key_disable(static_key*)'
  [A] 'function long int strncpy_from_user(char*, const char*, long int)'
  [A] 'function int sysfs_create_bin_file(kobject*, const bin_attribute*)'
  [A] 'function void sysfs_remove_bin_file(kobject*, const bin_attribute*)'
  [A] 'function bool task_may_not_preempt(task_struct*, int)'
  [A] 'function int thermal_zone_get_slope(thermal_zone_device*)'
  [A] 'function ktime_t tick_nohz_get_sleep_length(ktime_t*)'
  [A] 'function unsigned long int total_swapcache_pages()'
  [A] 'function const char* trace_print_flags_seq(trace_seq*, const char*, unsigned long int, const trace_print_flags*)'
  [A] 'function const char* trace_print_hex_seq(trace_seq*, const unsigned char*, int, bool)'
  [A] 'function int tracepoint_probe_register_prio(tracepoint*, void*, void*, int)'
  [A] 'function int ufshcd_shutdown(ufs_hba*)'
  [A] 'function int update_devfreq(devfreq*)'
  [A] 'function void usb_phy_set_charger_current(usb_phy*, unsigned int)'
  [A] 'function void usb_put_dev(usb_device*)'
  [A] 'function usb_role_switch* usb_role_switch_find_by_fwnode(const fwnode_handle*)'
  [A] 'function int vm_insert_page(vm_area_struct*, unsigned long int, page*)'
  [A] 'function unsigned long int vmalloc_nr_pages()'
  [A] 'function bool zone_watermark_ok(zone*, unsigned int, unsigned long int, int, unsigned int)'
  [A] 'function bool zone_watermark_ok_safe(zone*, unsigned int, unsigned long int, int)'

2472 functions with some sub-type change:

  [C] 'function void* PDE_DATA(const inode*)' at generic.c:799:1 has some sub-type changes:
    CRC (modversions) changed from 0x7aae1df7 to 0x9d4e937a

  [C] 'function void __ClearPageMovable(page*)' at compaction.c:138:1 has some sub-type changes:
    CRC (modversions) changed from 0x10923ef0 to 0xbca697b6

  [C] 'function void __SetPageMovable(page*, address_space*)' at compaction.c:130:1 has some sub-type changes:
    CRC (modversions) changed from 0x78273bab to 0xbae6e38b

  ... 2469 omitted; 2472 symbols have only CRC changes

18 Added variables:

  [A] 'tracepoint __tracepoint_android_rvh_check_preempt_wakeup'
  [A] 'tracepoint __tracepoint_android_rvh_cpufreq_transition'
  [A] 'tracepoint __tracepoint_android_rvh_pick_next_entity'
  [A] 'tracepoint __tracepoint_android_rvh_sched_balance_rt'
  [A] 'tracepoint __tracepoint_android_rvh_select_task_rq_rt'
  [A] 'tracepoint __tracepoint_android_vh_allow_domain_state'
  [A] 'tracepoint __tracepoint_android_vh_ipi_stop'
  [A] 'tracepoint __tracepoint_android_vh_printk_hotplug'
  [A] 'tracepoint __tracepoint_android_vh_timer_calc_index'
  [A] 'tracepoint __tracepoint_cpu_frequency_limits'
  [A] 'tracepoint __tracepoint_ipi_entry'
  [A] 'tracepoint __tracepoint_ipi_raise'
  [A] 'tracepoint __tracepoint_irq_handler_entry'
  [A] 'tracepoint __tracepoint_sched_switch'
  [A] 'device_type i2c_client_type'
  [A] 'int overflowuid'
  [A] 'atomic_long_t vm_node_stat[38]'
  [A] 'atomic_long_t vm_zone_stat[12]'

47 Changed variables:

  [C] 'pglist_data contig_page_data' was changed at memblock.c:96:1:
    CRC (modversions) changed from 0xdeb74410 to 0x17ba9562
    type of variable changed:
      type size hasn't changed
      1 data member insertion:
        'deferred_split pglist_data::deferred_split_queue', at offset 54336 (in bits) at mmzone.h:828:1
      there are data member changes:
        2 ('lruvec pglist_data::__lruvec' .. 'unsigned long int pglist_data::flags') offsets changed (by +256 bits)
      2529 impacted interfaces

  [C] 'rq runqueues' was changed at core.c:51:1:
    CRC (modversions) changed from 0x7d8ddb7c to 0xa7379acd
    type of variable changed:
      type size hasn't changed
      1 data member insertion:
        'ktime_t rq::hrtick_time', at offset 25344 (in bits) at sched.h:1029:1
      there are data member changes:
        11 ('sched_info rq::rq_sched_info' .. 'u64 rq::android_vendor_data1[96]') offsets changed (by +64 bits)
      2529 impacted interfaces

  [C] 'bus_type amba_bustype' was changed at bus.c:215:1:
    CRC (modversions) changed from 0xa38da620 to 0xca23025

  [C] 'const clk_ops clk_fixed_factor_ops' was changed at clk-fixed-factor.c:60:1:
    CRC (modversions) changed from 0x6d350258 to 0x96009648

  [C] 'const clk_ops clk_fixed_rate_ops' was changed at clk-fixed-rate.c:46:1:
    CRC (modversions) changed from 0x6a810889 to 0xda835cdb

  ... 42 omitted; 45 symbols have only CRC changes

'enum cpuhp_state at cpuhotplug.h:25:1' changed:
  type size hasn't changed
  1 enumerator insertion:
    'cpuhp_state::CPUHP_AP_DTPM_CPU_ONLINE' value '215'
  2 enumerator changes:
    'cpuhp_state::CPUHP_AP_ACTIVE' from value '215' to '216' at cpuhotplug.h:25:1
    'cpuhp_state::CPUHP_ONLINE' from value '216' to '217' at cpuhotplug.h:25:1
  5 impacted interfaces
'struct address_space at fs.h:451:1' changed:
  type size changed from 1344 to 1408 (in bits)
  1 data member insertion:
    'atomic_t address_space::nr_thps', at offset 256 (in bits) at fs.h:458:1
  there are data member changes:
    11 ('rb_root_cached address_space::i_mmap' .. 'void* address_space::private_data') offsets changed (by +64 bits)
  2529 impacted interfaces

'struct amba_driver at bus.h:76:1' changed:
  type size hasn't changed
  there are data member changes:
    type 'int (amba_device*)*' of 'amba_driver::remove' changed:
      pointer type changed from: 'int (amba_device*)*' to: 'void (amba_device*)*'
  2 impacted interfaces

'struct block_device at blk_types.h:22:1' changed:
  type size changed from 1472 to 1536 (in bits)
  1 data member insertion:
    'super_block* block_device::bd_fsfreeze_sb', at offset 1472 (in bits) at blk_types.h:49:1
  2529 impacted interfaces

'struct drm_crtc_helper_funcs at drm_modeset_helper_vtables.h:61:1' changed (indirectly):
  type size hasn't changed
  there are data member changes:
    type 'int (drm_crtc*, drm_framebuffer*, int, int, enum mode_set_atomic)*' of 'drm_crtc_helper_funcs::mode_set_base_atomic' changed:
      pointer type changed from: 'int (drm_crtc*, drm_framebuffer*, int, int, enum mode_set_atomic)*' to: 'int (drm_crtc*, drm_framebuffer*, int, int, enum mode_set_atomic)*'
  246 impacted interfaces

'struct em_perf_domain at energy_model.h:43:1' changed:
  type size hasn't changed
  1 data member insertion:
    'int em_perf_domain::milliwatts', at offset 96 (in bits) at energy_model.h:48:1
  2529 impacted interfaces

'struct inode at fs.h:610:1' changed (indirectly):
  type size changed from 4800 to 4864 (in bits)
  there are data member changes:
    type 'struct address_space' of 'inode::i_data' changed, as reported earlier
    'list_head inode::i_devices' offset changed (by +64 bits)
    while looking at anonymous data member 'union {pipe_inode_info* i_pipe; block_device* i_bdev; cdev* i_cdev; char* i_link; unsigned int i_dir_seq;}':
    the internal name of that anonymous data member changed from:
     __anonymous_union__51
    to:
     __anonymous_union__27
     This is usually due to an anonymous member type being added or removed from the containing type
    and offset changed from 4416 to 4480 (in bits) (by +64 bits)
    6 ('__u32 inode::i_generation' .. 'void* inode::i_private') offsets changed (by +64 bits)
  2529 impacted interfaces

'struct module at module.h:366:1' changed:
  type size hasn't changed
  1 data member insertion:
    'cfi_check_fn module::cfi_check', at offset 1920 (in bits) at module.h:389:1
  there are data member changes:
    15 ('mutex module::param_lock' .. 'int ()* module::init') offsets changed (by +64 bits)
  2529 impacted interfaces

'struct pglist_data at mmzone.h:728:1' changed:
  details were reported earlier

'struct regulator_desc at driver.h:313:1' changed:
  type size changed from 2240 to 2304 (in bits)
  1 data member insertion:
    'bool regulator_desc::of_match_full_name', at offset 192 (in bits) at driver.h:319:1
  there are data member changes:
    52 ('const char* regulator_desc::regulators_node' .. 'unsigned int (unsigned int)* regulator_desc::of_map_mode') offsets changed (by +64 bits)
  32 impacted interfaces

'struct rq at sched.h:897:1' changed:
  details were reported earlier

'struct tty_ldisc_ops at tty_ldisc.h:175:1' changed:
  type size hasn't changed
  there are data member changes:
    type 'typedef ssize_t (tty_struct*, file*, unsigned char*, typedef size_t)*' of 'tty_ldisc_ops::read' changed:
      pointer type changed from: 'typedef ssize_t (tty_struct*, file*, unsigned char*, typedef size_t)*' to: 'typedef ssize_t (tty_struct*, file*, unsigned char*, typedef size_t, void**, unsigned long int)*'
  27 impacted interfaces

'struct ufs_hba_variant_ops at ufshcd.h:301:1' changed:
  type size changed from 1728 to 1408 (in bits)
  5 data member deletions:
    'int (ufs_hba*, ufshcd_lrb*, unsigned int)* ufs_hba_variant_ops::fill_prdt', at offset 1408 (in bits) at ufshcd.h:335:1
    'int (ufs_hba*, request*, ufshcd_lrb*)* ufs_hba_variant_ops::prepare_command', at offset 1472 (in bits) at ufshcd.h:337:1
    'int (ufs_hba*)* ufs_hba_variant_ops::update_sysfs', at offset 1536 (in bits) at ufshcd.h:339:1
    'void (ufs_hba*, ufshcd_lrb*)* ufs_hba_variant_ops::send_command', at offset 1600 (in bits) at ufshcd.h:340:1
    'void (ufs_hba*, ufshcd_lrb*)* ufs_hba_variant_ops::compl_command', at offset 1664 (in bits) at ufshcd.h:341:1
  15 impacted interfaces

'struct vm_area_struct at mm_types.h:306:1' changed (indirectly):
  type size changed from 1536 to 1600 (in bits)
  there are data member changes:
    'seqcount_t vm_area_struct::vm_sequence' offset changed (by +64 bits)
    type 'struct vm_userfaultfd_ctx' of 'vm_area_struct::vm_userfaultfd_ctx' changed:
      type size changed from 0 to 64 (in bits)
      1 data member insertion:
        'userfaultfd_ctx* vm_userfaultfd_ctx::ctx', at offset 0 (in bits) at mm_types.h:293:1
      2529 impacted interfaces
    'atomic_t vm_area_struct::vm_ref_count' offset changed (by +64 bits)
  2529 impacted interfaces

'struct vm_userfaultfd_ctx at mm_types.h:297:1' changed:
  details were reported earlier

'struct zone at mmzone.h:450:1' changed:
  type size hasn't changed
  1 data member insertion:
    'unsigned long int zone::cma_pages', at offset 960 (in bits) at mmzone.h:529:1
  there are data member changes:
    4 ('const char* zone::name' .. 'int zone::initialized') offsets changed (by +64 bits)
  2529 impacted interfaces

Bug: 182194803
Fixes: ba01e93b417a58 ("FROMLIST: kbuild: add support for Clang LTO")
Change-Id: If6011ad739ecccd23a92cfa2f9fd43084f9a0b4f
Signed-off-by: Giuliano Procida <gprocida@google.com>
diff --git a/Makefile b/Makefile
index 88b6444..5e5a887 100644
--- a/Makefile
+++ b/Makefile
@@ -906,7 +906,13 @@
 else
 CC_FLAGS_LTO	+= -flto
 endif
+
+ifeq ($(SRCARCH),x86)
+# Workaround for compiler / linker bug
 CC_FLAGS_LTO	+= -fvisibility=hidden
+else
+CC_FLAGS_LTO	+= -fvisibility=default
+endif
 
 # Limit inlining across translation units to reduce binary size
 KBUILD_LDFLAGS += -mllvm -import-instr-limit=5