Question [OnePlus Nord CE 5G][Build Kernel][sm7225] Error - Undefined References - OnePlus Nord CE 5G

Hi,
i'm trying to compile this kernel - android_kernel_oneplus_sm7225 ver. 4.19.125 - and i need some hints about how to proceed, because it fails.
After the fixes (see section "SOME FIXES" below), i get a lot of "Undefined reference" errors (below the related section) at the end of the procedure.
QUESTIONS:
What i'm doing wrong? The only way that i found to solve those errors is to add the missing code in each file, but i'm not sure this is the right way!
Do i have to add library path somewhere?
It's my first try and i would thank anyone who'll help me to get out of this!
Any useful (and detailed) guide?
thanks in advance
- All the info -
I've tried to build the kernel under Ubuntu ( 21.10, 18.04, 16.04 with also different kernel version on them) and Arch, but the result is the same.
Here there are:
the kernel sources
the compiler
the toolchain
the missing headers and some little variations made
the list of the undefined references found
###########################
# SOURCES - COMPILER - TOOLCHAIN
GitHub - OnePlusOSS/android_kernel_oneplus_sm7225
Contribute to OnePlusOSS/android_kernel_oneplus_sm7225 development by creating an account on GitHub.
github.com
clang:
https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+archive/ee5ad7f5229892ff06b476e5b5a11ca1f39bf3a9/clang-r365631c.tar.gz
gcc32
https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/+archive/5ac02a0ba9f39591758bab4516dd0725747af0c3.tar.gz
gcc64:
https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/+archive/043dc0ad16a73e0e1973132d00fa6265ab4fa6ba.tar.gz
###########################
# THE SCRIPT
git clone --depth 1 https://github.com/OnePlusOSS/android_kernel_oneplus_sm7225 src
wget https://android.googlesource.com/pl...6b476e5b5a11ca1f39bf3a9/clang-r365631c.tar.gz -O clang.tar.gz
mkdir clang
tar -xvf clang.tar.gz -C clang
wget https://android.googlesource.com/pl...3dc0ad16a73e0e1973132d00fa6265ab4fa6ba.tar.gz -O gcc64.tar.gz
mkdir gcc64
tar -xvf gcc64.tar.gz -C gcc64
wget https://android.googlesource.com/pl...c02a0ba9f39591758bab4516dd0725747af0c3.tar.gz -O gcc32.tar.gz
mkdir gcc32
tar -xvf gcc32.tar.gz -C gcc32
export ARCH=arm64
export SUBARCH=arm64
export HEADER_ARCH=arm64
export DTC_EXT=dtc
PATH="${PWD}/clang/bin:${PWD}/gcc64/bin:${PWD}/gcc32/bin:${PATH}"
cd src
rm -rf out
make O=out clean && make mrproper
make O=out ARCH=arm64 vendor/lito-perf_defconfig
make CONFIG_DEBUG_SECTION_MISMATCH=y CONFIG_SECTION_MISMATCH_WARN_ONLY=y -j$(nproc --all) O=out ARCH=arm64 CC=clang CLANG_TRIPLE=aarch64-linux-gnu- CROSS_COMPILE=aarch64-linux-android- CROSS_COMPILE_ARM32=arm-linux-androideabi-
###########################
# SOME FIXES
/arch/arm64/configs/vendor/lito-perf_defconfig
CONFIG_ARCH_QCOM=y -> # CONFIG_ARCH_QCOM=y
/drivers/extcon/extcon-gpio.c
add #include <linux/pinctrl/consumer.h>
/drivers/input/touchscreen/focaltech_touch/focaltech_core.c
add #include <linux/pinctrl/consumer.h>
/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_core.c
add #include <linux/pinctrl/consumer.h>
/drivers/input/touchscreen/st/fts.c
add #include <linux/pinctrl/consumer.h>
/drivers/leds/leds.h
add #include <linux/pinctrl/consumer.h>
comment method static inline struct led_classdev *trigger_to_lcdev(struct led_trigger *trig)
/drivers/leds/led-core.c
add #include <linux/pinctrl/consumer.h>
/drivers/oneplus/input/fingerprint/fingerprint_detect/fingerprint_detect.c
add #include <linux/pinctrl/consumer.h>
/drivers/oneplus/input/touchscreen/touchpanel_common_driver.c
add #include <linux/pinctrl/consumer.h>
/drivers/oneplus/input/fingerprint/goodix/gf_spi.c
add #include <linux/pinctrl/consumer.h>
/drivers/oneplus/input/fingerprint/goodix/platform.c
add #include <linux/pinctrl/consumer.h>
/drivers/oneplus/misc/project_info.c
add #include <linux/io.h>
/drivers/oneplus/misc/op_rf_cable_monitor.c
add #include <linux/pinctrl/consumer.h>
/drivers/oneplus/misc/gpio_switch.c
add #include <linux/pinctrl/consumer.h>
/drivers/oneplus/power/oplus_chg/charger_ic/oplus_battery_msm7225_R.c
add #include <linux/pinctrl/consumer.h>
/drivers/oneplus/power/oplus_chg/charger_ic/oplus_usbtemp.c
add #include <linux/pinctrl/consumer.h>
/drivers/oneplus/power/oplus_chg/warp_ic/oplus_warp_fw.c
add #include <linux/pinctrl/consumer.h>
/drivers/oneplus/power/oplus_chg/oplus_wireless.c
add #include <linux/pinctrl/consumer.h>
/drivers/oneplus/vibrator/aw8697.c
add #include <linux/pinctrl/consumer.h>
##################
# UNDEFINED REFERENCES (attached file)
...
WARNING: vmlinux.o(.text+0xa05f1c): Section mismatch in reference from the function bootloader_log_probe() to the function .init.textf_bootloader_log_platform_data()
The function bootloader_log_probe() references
the function __init of_bootloader_log_platform_data().
This is often because bootloader_log_probe lacks a __init
annotation or the annotation of of_bootloader_log_platform_data is wrong.
drivers/clk/clk.o: In function `clock_debug_print_enabled':
/src/out/../drivers/clk/clk.c:3956: undefined reference to `rpmhstats_statistics'
drivers/soc/qcom/subsys-pil-tz.o: In function `log_failure_reason':
/src/out/../drivers/soc/qcom/subsys-pil-tz.c:808: undefined reference to `qcom_smem_get'
drivers/soc/qcom/peripheral-loader.o: In function `msm_pil_init':
/src/out/../drivers/soc/qcom/peripheral-loader.c:1689: undefined reference to `qcom_smem_get'
drivers/soc/qcom/subsystem_restart.o: In function `subsystem_restart_dev':
/src/out/../drivers/soc/qcom/subsystem_restart.c:1500: undefined reference to `oem_get_modemdump_mode'
drivers/soc/qcom/microdump_collector.o: In function `microdump_modem_notifier_nb':
/src/out/../drivers/soc/qcom/microdump_collector.c:45: undefined reference to `qcom_smem_get'
/src/out/../drivers/soc/qcom/microdump_collector.c:57: undefined reference to `qcom_smem_get'
drivers/soc/qcom/icnss.o: In function `icnss_socinfo_get_serial_number':
/src/out/../drivers/soc/qcom/icnss.c:2579: undefined reference to `socinfo_get_serial_number'
drivers/soc/qcom/icnss_qmi.o: In function `wlfw_msa_mem_info_send_sync_msg':
/src/out/../drivers/soc/qcom/icnss_qmi.c:91: undefined reference to `qmi_txn_init'
/src/out/../drivers/soc/qcom/icnss_qmi.c:99: undefined reference to `qmi_send_request'
/src/out/../drivers/soc/qcom/icnss_qmi.c:109: undefined reference to `qmi_txn_wait'
/src/out/../drivers/soc/qcom/icnss_qmi.c:104: undefined reference to `qmi_txn_cancel'
drivers/soc/qcom/icnss_qmi.o: In function `wlfw_msa_ready_send_sync_msg':
vers/gpu/drm/drm_sysfs.c:325: undefined reference to `dsi_display_get_hbm_mode'
drivers/gpu/drm/drm_sysfs.o: In function `hbm_store':
/src/out/../drivers/gpu/drm/drm_sysfs.c:352: undefined reference to `dsi_panel_name'
aarch64-linux-android-ld: drivers/gpu/drm/drm_sysfs.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `dsi_panel_name' can not be used when making a shared object; recompile with -fPIC
/src/out/../drivers/gpu/drm/drm_sysfs.c:352: undefined reference to `dsi_panel_name'
/src/out/../drivers/gpu/drm/drm_sysfs.c:353: undefined reference to `dsi_display_get_stage_info'
/src/out/../drivers/gpu/drm/drm_sysfs.c:361: undefined reference to `dsi_display_set_hbm_mode'
drivers/gpu/drm/drm_sysfs.o: In function `hbm_brightness_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:416: undefined reference to `dsi_display_get_hbm_brightness'
drivers/gpu/drm/drm_sysfs.o: In function `hbm_brightness_store':
/src/out/../drivers/gpu/drm/drm_sysfs.c:435: undefined reference to `dsi_display_set_hbm_brightness'
drivers/gpu/drm/drm_sysfs.o: In function `op_friginer_print_hbm_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:448: undefined reference to `dsi_display_get_fp_hbm_mode'
drivers/gpu/drm/drm_sysfs.o: In function `op_friginer_print_hbm_store':
/src/out/../drivers/gpu/drm/drm_sysfs.c:470: undefined reference to `dsi_display_set_fp_hbm_mode'
drivers/gpu/drm/drm_sysfs.o: In function `aod_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:484: undefined reference to `dsi_display_get_aod_mode'
drivers/gpu/drm/drm_sysfs.o: In function `aod_store':
/src/out/../drivers/gpu/drm/drm_sysfs.c:503: undefined reference to `dsi_display_set_aod_mode'
drivers/gpu/drm/drm_sysfs.o: In function `aod_disable_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:516: undefined reference to `dsi_display_get_aod_disable'
drivers/gpu/drm/drm_sysfs.o: In function `aod_disable_store':
/src/out/../drivers/gpu/drm/drm_sysfs.c:538: undefined reference to `dsi_display_set_aod_disable'
drivers/gpu/drm/drm_sysfs.o: In function `DCI_P3_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:552: undefined reference to `dsi_display_get_dci_p3_mode'
drivers/gpu/drm/drm_sysfs.o: In function `DCI_P3_store':
/src/out/../drivers/gpu/drm/drm_sysfs.c:574: undefined reference to `dsi_display_set_dci_p3_mode'
drivers/gpu/drm/drm_sysfs.o: In function `night_mode_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:588: undefined reference to `dsi_display_get_night_mode'
drivers/gpu/drm/drm_sysfs.o: In function `night_mode_store':
/src/out/../drivers/gpu/drm/drm_sysfs.c:610: undefined reference to `dsi_display_set_night_mode'
drivers/gpu/drm/drm_sysfs.o: In function `native_display_p3_mode_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:624: undefined reference to `dsi_display_get_native_display_p3_mode'
drivers/gpu/drm/drm_sysfs.o: In function `native_display_p3_mode_store':
/src/out/../drivers/gpu/drm/drm_sysfs.c:646: undefined reference to `dsi_display_set_native_display_p3_mode'
...
drivers/gpu/drm/drm_sysfs.o: In function `native_display_srgb_color_mode_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:803: undefined reference to `dsi_display_get_native_display_srgb_color_mode'
drivers/gpu/drm/drm_sysfs.o: In function `native_display_srgb_color_mode_store':
/src/out/../drivers/gpu/drm/drm_sysfs.c:825: undefined reference to `dsi_display_set_native_display_srgb_color_mode'
...
drivers/gpu/drm/drm_sysfs.o: In function `panel_serial_number_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:943: undefined reference to `dsi_display_get_serial_number'
/src/out/../drivers/gpu/drm/drm_sysfs.c:945: undefined reference to `dsi_display_get_serial_number_year'
/src/out/../drivers/gpu/drm/drm_sysfs.c:946: undefined reference to `dsi_display_get_serial_number_mon'
...
aarch64-linux-android-ld: drivers/gpu/drm/drm_sysfs.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `dsi_panel_name' can not be used when making a shared object; recompile with -fPIC
/src/out/../drivers/gpu/drm/drm_sysfs.c:959: undefined reference to `dsi_panel_name'
/src/out/../drivers/gpu/drm/drm_sysfs.c:1078: undefined reference to `dsi_display_get_panel_ic_v_info'
/src/out/../drivers/gpu/drm/drm_sysfs.c:1066: undefined reference to `dsi_display_get_ddic_check_info'
...
aarch64-linux-android-ld: drivers/gpu/drm/drm_sysfs.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `buf_Lotid' can not be used when making a shared object; recompile with -fPIC
/src/out/../drivers/gpu/drm/drm_sysfs.c:1122: undefined reference to `buf_Lotid'
drivers/gpu/drm/drm_sysfs.o: In function `panel_serial_number_AT_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:1175: undefined reference to `dsi_display_get_serial_number_at'
drivers/gpu/drm/drm_sysfs.o: In function `iris_recovery_mode_check_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:1187: undefined reference to `iris_loop_back_test'
drivers/gpu/drm/drm_sysfs.o: In function `dsi_on_command_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:1200: undefined reference to `dsi_display_get_dsi_on_command'
drivers/gpu/drm/drm_sysfs.o: In function `dsi_on_command_store':
/src/out/../drivers/gpu/drm/drm_sysfs.c:1211: undefined reference to `dsi_display_update_dsi_on_command'
drivers/gpu/drm/drm_sysfs.o: In function `dsi_panel_command_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:1224: undefined reference to `dsi_display_get_dsi_panel_command'
...
drivers/gpu/drm/drm_sysfs.o: In function `dsi_panel_reg_len_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:1271: undefined reference to `reg_read_len'
aarch64-linux-android-ld: drivers/gpu/drm/drm_sysfs.o: relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `reg_read_len' can not be used when making a shared object; recompile with -fPIC
...
drivers/gpu/drm/drm_sysfs.o: In function `dsi_panel_reg_read_store':
/src/out/../drivers/gpu/drm/drm_sysfs.c:1313: undefined reference to `dsi_display_reg_read'
drivers/gpu/drm/drm_sysfs.o: In function `panel_mismatch_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:1398: undefined reference to `dsi_display_panel_mismatch_check'
/src/out/../drivers/gpu/drm/drm_sysfs.c:1400: undefined reference to `dsi_display_panel_mismatch'
drivers/gpu/drm/drm_sysfs.o: In function `force_screenfp_show':
/src/out/../drivers/gpu/drm/drm_sysfs.c:1439: undefined reference to `dsi_display_get_fp_hbm_mode'
/src/out/../drivers/gpu/drm/drm_sysfs.c:397: undefined reference to `dsi_panel_name'
...
drivers/oneplus/power/oplus_chg/charger_ic/oplus_battery_msm7225_R.o: /src/out/../drivers/oneplus/power/oplus_chg/charger_ic/oplus_battery_msm7225_R.c:5496: more undefined references to `vote' follow
drivers/oneplus/power/oplus_chg/charger_ic/oplus_battery_msm7225_R.o: In function `usbin_uv_irq_handler':
/src/out/../drivers/oneplus/power/oplus_chg/charger_ic/oplus_battery_msm7225_R.c:5865: undefined reference to `is_storming'
/src/out/../drivers/oneplus/power/oplus_chg/charger_ic/oplus_battery_msm7225_R.c:6006: undefined reference to `reset_storm_count'
drivers/oneplus/power/oplus_chg/charger_ic/oplus_battery_msm7225_R.o: In function `icl_change_irq_handler':
drivers/oneplus/power/oplus_chg/charger_ic/oplus_battery_msm7225_R.o: In function `smblib_set_sw_thermal_regulation':
drivers/oneplus/power/oplus_chg/charger_ic/oplus_battery_msm7225_R.o: In function `smblib_handle_rp_change':
/src/out/../drivers/oneplus/power/oplus_chg/charger_ic/oplus_battery_msm7225_R.c:7200: undefined reference to `get_client_vote'
drivers/oneplus/power/oplus_chg/charger_ic/oplus_battery_msm7225_R.o: In function `smblib_lpd_clear_ra_open_work':
/src/out/../drivers/oneplus/power/oplus_chg/charger_ic/oplus_battery_msm7225_R.c:7360: undefined reference to `vote'
drivers/oneplus/power/oplus_chg/charger_ic/oplus_battery_msm7225_R.o: In function `typec_ra_ra_insertion':
/src/out/../drivers/oneplus/power/oplus_chg/charger_ic/oplus_battery_msm7225_R.c:7003: undefined reference to `vote'
/src/out/../drivers/oneplus/power/oplus_chg/charger_ic/oplus_battery_msm7225_R.c:7004: undefined reference to `vote'
... (and so on) ...
drivers/oneplus/vl53L1/stmvl53l1_module.o: /src/out/../drivers/oneplus/vl53L1/stmvl53l1_module.c:417: more undefined references to `cam_cci_control_interface' follow
/src/Makefile:1198: recipe for target 'vmlinux' failed
make[1]: *** [vmlinux] Error 1
make[1]: uscita dalla directory " /src/out"
Makefile:148: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

try build with attach script, just edit ci_build.cfg

GriefNorth said:
try build with attach script, just edit ci_build.cfg
Click to expand...
Click to collapse
Thank you! I ll'try

The script gave me the same error, but then i've solved restarting from the kernel src and fixing only the error related to the qcom module.

Related

Compile ADWLauncher

Hi everyone,
I cloned AOSP 2.2 sources
and then I replace Launcher2 folder in packages/apps with ADWLauncher from AndersWeb's github
Then "Make Launcher" returns me this:
Code:
target R.java/Manifest.java: Launcher2 (out/target/common/obj/APPS/Launcher2_intermediates/src/R.stamp)
target Java: Launcher2 (out/target/common/obj/APPS/Launcher2_intermediates/classes)
packages/apps/Launcher2/src/com/android/launcher/Launcher.java:1221: cannot find symbol
symbol : variable SOURCE
location: class android.app.SearchManager
appSearchData.putString(SearchManager.SOURCE, "launcher-search");
^
packages/apps/Launcher2/src/com/android/launcher/MyLauncherSettings.java:58: method does not override a method from its superclass
@Override
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
make: *** [out/target/common/obj/APPS/Launcher2_intermediates/classes-full-debug.jar] Erreur 41
Here is the result from standalone branch:
Code:
target R.java/Manifest.java: Launcher (out/target/common/obj/APPS/Launcher_intermediates/src/R.stamp)
aapt: warning: string 'pref_dialog_drawer_background_alpha' has no default translation in packages/apps/android_packages_apps_Launcher/res; found: el es
aapt: warning: string 'pref_summary_drawer_background_alpha' has no default translation in packages/apps/android_packages_apps_Launcher/res; found: el es
aapt: warning: string 'pref_title_drawer_background_alpha' has no default translation in packages/apps/android_packages_apps_Launcher/res; found: el es
Warning: AndroidManifest.xml already defines versionCode (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines versionName (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines minSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
target Java: Launcher (out/target/common/obj/APPS/Launcher_intermediates/classes)
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/Workspace.java:1773: method does not override a method from its superclass
@Override
^
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/Workspace.java:1778: method does not override a method from its superclass
@Override
^
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/Workspace.java:1784: method does not override a method from its superclass
@Override
^
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/Workspace.java:1793: method does not override a method from its superclass
@Override
^
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/DesktopIndicator.java:212: method does not override a method from its superclass
@Override
^
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/DesktopIndicator.java:217: method does not override a method from its superclass
@Override
^
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/DesktopIndicator.java:221: method does not override a method from its superclass
@Override
^
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/MyLauncherSettings.java:101: method does not override a method from its superclass
@Override
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
8 errors
make: *** [out/target/common/obj/APPS/Launcher_intermediates/classes-full-debug.jar] Erreur 41
Could you help me?
thx
You should remove the override lines,
And for froyo, there's no an official system branch made by myself. I'd need to remove a few code parts, cause in froyo, the search widget is no more needed inside the launcher.
AnderWeb said:
You should remove the override lines,
And for froyo, there's no an official system branch made by myself. I'd need to remove a few code parts, cause in froyo, the search widget is no more needed inside the launcher.
Click to expand...
Click to collapse
Okay.
Thank you very much.
Hope you'll release the sources for FroYo soon
leonnib4 said:
Okay.
Thank you very much.
Hope you'll release the sources for FroYo soon
Click to expand...
Click to collapse
The actual standalone branch is froyo compatible, you just need to remove the overrides if you don't build within eclipse.
AnderWeb said:
The actual standalone branch is froyo compatible, you just need to remove the overrides if you don't build within eclipse.
Click to expand...
Click to collapse
thanks!
10chars
Hi leo, its nice to see that we are working and struggling in the same stuff, great minds think alike and it seems they mess alike too ^^
Anyway nice work both of you.
Since the repo was updated,
I only had to remove some @overides as AndersWeb told me and everything was fine.

[Q] COMILE ERROR : undefined reference to `__bad_udelay'

Is there anyone to give advice to me this compiling error?
When compile with CFLAG '-O2' option, it's successful but '-O3' can't be.
Compile Error message :
drivers/built-in.o: In function `mcsdl_delay':
Kernel/drivers/input/keyboard/melfas_download.c:1779: undefined reference to `__bad_udelay'
Kernel/drivers/input/keyboard/melfas_download.c:1779: undefined reference to `__bad_udelay'
Kernel/drivers/input/keyboard/melfas_download.c:1779: undefined reference to `__bad_udelay'
Kernel/drivers/input/keyboard/melfas_download.c:1779: undefined reference to `__bad_udelay'
Kernel/drivers/input/keyboard/melfas_download.c:1779: undefined reference to `__bad_udelay'
make: *** [.tmp_vmlinux1] Error 1
Compiling infor is following;
- galaxy S M110S
- Toolchain :codesourcery 2010.9-51 arm-none-eabi-
- compile option : -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common \
-Werror-implicit-function-declaration \
-Wno-format-security \
-fno-delete-null-pointer-checks \
-mcpu=cortex-a8 \
-mfpu=neon -mfloat-abi=softfp
- KBUILD_CFLAGS += -O3
The body of 'melfas_download.c' about 1779line
Code:
//============================================================
//
// Delay Function
//
//============================================================
static void mcsdl_delay(UINT32 nCount)
{
#if 1
udelay(nCount); //1 Baseband delay function
#else
UINT32 i;
for(i=0;i<nCount;i++){
}
#endif
}

problem when build LKM

Here is a loadable kernel module for HTC Sensation XL (runnymede-crc-2.6.35).
/*
* mydebug.c
* System Call sys_open dubugging
*/
#include <linux/kernel.h> /* Needed for KERN_INFO */
#include <linux/module.h> /* Needed by all modules */
#include <linux/init.h> /* Needed for macros */
#include <asm/unistd.h>
#include <linux/linkage.h>
#include <generated/autoconf.h>
#include <linux/in.h>
#include <linux/init_task.h>
#include <linux/ip.h>
#include <linux/kernel.h>
#include <linux/kmod.h>
#include <linux/mm.h>
#include <linux/skbuff.h>
#include <linux/workqueue.h>
#include <linux/sched.h>
#include <linux/stddef.h>
#include <linux/string.h>
#include <linux/syscalls.h>
#include <linux/tcp.h>
#include <linux/types.h>
#include <linux/version.h>
asmlinkage ssize_t (*orig_open)(const char *pathname, int flags);
asmlinkage ssize_t hooked_open(const char *pathname, int flags)
{
printk(KERN_INFO "SYS_OPEN: %s\n", pathname);
return orig_open(pathname, flags);
}
static int __init root_start(void)
{
unsigned long sys_addr = 0xc003b104; /* System.map */
unsigned long *sys_call_table= (unsigned long *)sys_addr;
orig_open = sys_call_table[__NR_open];
sys_call_table[__NR_open] = hooked_open;
return 0;
}
static void __exit root_stop(void)
{
unsigned long sys_addr = 0xc003b104;
unsigned long *sys_call_table= (unsigned long *)sys_addr;
sys_call_table[__NR_open] = &orig_open;
}
module_init(root_start);
module_exit(root_stop);
-------
When I buid it, the error shows below,
make -C /home/scott/runnymede-crc-2.6.35/ M=`pwd` ARCH=arm CROSS_COMPILE=~/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- modules
make[1]: Entering directory `<home>/runnymede-crc-2.6.35'
CC [M] /<home>/workspace/debugkit/mydebug.o
cc1: warnings being treated as errors
/<home>/workspace/debugkit/mydebug.c: In function 'root_start':
/<home>/workspace/debugkit/mydebug.c:44: error: assignment makes pointer from integer without a cast
/<home>/workspace/debugkit/mydebug.c:45: error: assignment makes integer from pointer without a cast
/<home>/workspace/debugkit/mydebug.c: In function 'root_stop':
/<home>/workspace/debugkit/mydebug.c:55: error: assignment makes integer from pointer without a cast
make[2]: *** [/<home>/workspace/debugkit/mydebug.o] Error 1
make[1]: *** [_module_/<home>/workspace/debugkit] Error 2
make[1]: Leaving directory `/home/scott/runnymede-crc-2.6.35'
make: *** [default] Error 2
Anyone can give me a help for it?
2 things...
you should change in the menu : warnings being treated as errors...this will stop building the kernel also if its only a warning
also you can have probs with the toolchain...you can try this:
http://forum.xda-developers.com/showpost.php?p=23367049&postcount=112
with kind regards

[Q][Kernel][DEVS] 3.0.8 Kernel Question

Please HELP
I ported SIO,
THis is what i get:
Code:
block/sio-iosched.c:315:3: error: unknown field 'elevator_queue_empty_fn' specified in initializer
block/sio-iosched.c:315:3: warning: initialization from incompatible pointer type [enabled by default]
block/sio-iosched.c:315:3: warning: (near initialization for 'iosched_sio.ops.elevator_activate_req_fn') [enabled by default]
make[1]: *** [block/sio-iosched.o] Error 1
make: *** [block] Error 2
I only dont understand elevator queue empty. I think i should add a queue for it?
You porting SIO from where?
Do you know the basic of C language?
Read this GNU GCC.
nicholaschw said:
Please HELP
I ported SIO,
THis is what i get:
Code:
block/sio-iosched.c:315:3: error: [B]unknown field[/B] 'elevator_queue_empty_fn' [B]specified in initializer[/B]
block/sio-iosched.c:315:3: warning: initialization from incompatible pointer type [enabled by default]
block/sio-iosched.c:315:3: warning: (near initialization for 'iosched_sio.ops.elevator_activate_req_fn') [enabled by default]
make[1]: *** [block/sio-iosched.o] Error 1
make: *** [block] Error 2
I only dont understand elevator queue empty. I think i should add a queue for it?
Click to expand...
Click to collapse
I'll explain.
Code:
//Test Application
typedef struct _user{
const char* name;
const char* password;
char age;
} user;
int main(){
//And we initialize it
struct _user someUser = {
//Lets initialize the variables
.name = "James Bond",
.password = "007",
.age = 21,
//Lets be rebel and break it
.unkownVariable = "Unkown Value"
};
//You are calling a field thats not there
//Exit Gracefully
return 0;
}
The code you tried porting into your kernel is made for a different kernel (not 3.0.8) or you simply forgot a inlcude somewhere,
xonar_ said:
I'll explain.
Code:
//Test Application
typedef struct _user{
const char* name;
const char* password;
char age;
} user;
int main(){
//And we initialize it
struct _user someUser = {
//Lets initialize the variables
.name = "James Bond",
.password = "007",
.age = 21,
//Lets be rebel and break it
.unkownVariable = "Unkown Value"
};
//You are calling a field thats not there
//Exit Gracefully
return 0;
}
The code you tried porting into your kernel is made for a different kernel (not 3.0.8) or you simply forgot a inlcude somewhere,
Click to expand...
Click to collapse
Jackpot. I ported from 2. 6. 3. 5. Help me. Everything is ready in github
Sent from my LG-P970 using Tapatalk 2
nicholaschw said:
Jackpot. I ported from 2. 6. 3. 5. Help me. Everything is ready in github
Sent from my LG-P970 using Tapatalk 2
Click to expand...
Click to collapse
Try looking at what the headers look like to look for the difference that broke it. It's possible that they just changed the name and just renaming it could fix. Its also possible that they made crucial design changes and it will stay broken unless you port it from another kernel with very similar headers. I'm going to be busy now for a few hours so I can't check it now.
Sent from my LG-P970

how to inflate a layout which is in the res directory of my own module?

Hi everyone:
how could I use View.inflate() to inflate a layout which is in the res directory of my own module? I want to add this layout into the target app’s view container.
I had tried to generate a fakeId for this layout xml resource file by this way:
Code:
fun initZygote(startupParam: IXposedHookZygoteInit.StartupParam?) {
MODULE_PATH = startupParam?.modulePath
}
fun handleInitPackageResources(resparam: XC_InitPackageResources.InitPackageResourcesParam?) {
val modRes = XModuleResources.createInstance(MODULE_PATH, resparam.res)
ID_MENU = resparam.res.addResource(modRes, R.layout.menu_littlespider)
}
then I use this ID_MENU to to inflate it:
Code:
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?){
findAndHookMethod(C.View, "inflate", C.Context, C.Int, C.ViewGroup, object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam?) {
if (param == null) return
val context = param.args[0] as Context
var targetViewId = param.args[1] as Int
if (targetViewId == 2130904238) {
var targetView = param.result as LinearLayout
val layoutParser = context.resources.getLayout(InitResourceHooker.ID_MENU)
val menu = LayoutInflater.from(context).inflate(layoutParser, null)
//val menu = View.inflate(context, InitResourceHooker.ID_MENU, null) as LinearLayout
targetView.addView(menu, 0)
}
}
})
}
sadly,it gives me an error,#0x7eb8f41b is my FakeId :
Code:
android.content.res.Resources$NotFoundException: Resource ID #0x7eb8f41b
can anyone show me is it possible to inflate this layout?
thanks a lot!
吃泡面的猫儿 said:
Hi everyone:
how could I use View.inflate() to inflate a layout which is in the res directory of my own module? I want to add this layout into the target app’s view container.
I had tried to generate a fakeId for this layout xml resource file by this way:
then I use this ID_MENU to to inflate it:
sadly,it gives me an error,#0x7eb8f41b is my FakeId :
can anyone show me is it possible to inflate this layout?
thanks a lot!
Click to expand...
Click to collapse
Hint: use getResourcesForApplication
Background: Xposed hooks run in the context of the hooked app.
Also, you can inflate layout without adding it to hooked app resources provided you create instance of LayoutInflater using your xposed app context.
Code:
Context ctx = context.createPackageContext("your_xposed_app_pkg_name", Context.CONTEXT_IGNORE_SECURITY);
LayoutInflater inflater = LayoutInflater.from(ctx);
inflater.inflate(R.layout.your_layout, parent);
The thing is, layout can contain only such elements that are known to hooked app classloader.
E.g. you won't be able to inflate layout that contains some custom views that were defined within your app, as inflater created within hooked app won't be able to resolve them.
C3C076 said:
Also, you can inflate layout without adding it to hooked app resources provided you create instance of LayoutInflater using your xposed app context.
Code:
Context ctx = context.createPackageContext("your_xposed_app_pkg_name", Context.CONTEXT_IGNORE_SECURITY);
LayoutInflater inflater = LayoutInflater.from(ctx);
inflater.inflate(R.layout.your_layout, parent);
The thing is, layout can contain only such elements that are known to hooked app classloader.
E.g. you won't be able to inflate layout that contains some custom views that were defined within your app, as inflater created within hooked app won't be able to resolve them.
Click to expand...
Click to collapse
Hi, i wonder if i can inflate layout which is in res directory of my app target?

Categories

Resources