[Q] COMILE ERROR : undefined reference to `__bad_udelay' - Galaxy S I9000 Q&A, Help & Troubleshooting

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
}

Related

[TOOL] acHelper | Just small themers Tool | 001 | 29.09.2012

### Description:
I think that almost all themers gets tired when they needs to make resources-redirections file (at /res/xml/ folder).
### How to use it?
- Put themed icons to /acHelper/themed/ folder
- Run /acHelper/run.bat (If you're Linux user - launch achelper.jar by hands)
- Type icons prefix
- Enjoy
### Sources:
Code:
import java.io.File;
import java.io.IOException;
import java.io.FileWriter;
import java.util.Scanner;
import java.util.Date;
public class ThemeHelper {
private static final String VERSION_NAME = "0.1";
private static final String FOLDER_THEMED_NAME = "themed";
private static File mRootFolder = null;
public static void main(String[] args) {
try {
mRootFolder = new File(ThemeHelper.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getParentFile();
} catch (Exception ex) { return; }
logln(3);
logln("Program:");
logln(" acHelper "+VERSION_NAME);
logln("Contact:");
logln(" 2012 (C) [email protected]");
logln(" <[email protected]>");
logln(1);
log("Type resources prefix: ");
Scanner input = new Scanner(System.in);
String prefix = input.nextLine();
input.close();
logln("- - - - - - - - - - - - - - - - - -");
long beginTime = new Date().getTime();
createResourceRedirectionsFile(mRootFolder.getPath()+"/"+FOLDER_THEMED_NAME, prefix);
logln("- - - - - - - - - - - - - - - - - -");
logln(" Elapsed time: "+(new Date().getTime()-beginTime)+"ms.");
}
private static void createResourceRedirectionsFile(String directory, String patch){
int i, i2;
log(" - Building list of files... ");
final File[] files = new File(directory).listFiles(); logln("Successfully.");
log(" - Parcing files... ");
int length = files.length; String[] names = new String[length]; int ctrl = 0;
for (i = 0; i<length; i++) {
names[i+ctrl] = files[i].getName();
int nameLength = names[i+ctrl].length();
for (i2 = 0; i2 < nameLength; i2++)
if (names[i+ctrl].charAt(i2)=='.')
break;
if (i2 == nameLength) ctrl--;
else names[i+ctrl]=names[i+ctrl].substring(0, i2);
}
length = length+ctrl; logln(ctrl==0 ? "Successfully." : "Has warnings!");
try {
log(" - Opening output file... ");
File file = new File(mRootFolder
, patch.substring(0, patch.length()-1)+".xml");
file.delete();
FileWriter writer = new FileWriter(file); logln("Successfully.");
log(" - Parcing and writing values... ");
int patchLength = patch.length();
for (i = 0; i < length; i++){
if (names[i].length()>patchLength && names[i].substring(0, patchLength).equals(patch))
writer.append("<item name=\"drawable/"+names[i].substring(patchLength, names[i].length())+"\">@drawable/"+names[i]+"</item>\n");
}
writer.flush();
writer.close();
logln("Successfully.");
} catch (Exception ex) {
logln("Error!");
}
}
/**
* Short named analog of System.out.print(String msg);
*/
private static void log(String str){
System.out.print(str);
}
/**
* Recursive dividers
*/
private static void logln(int number){
if (number>1) logln(number-1);
logln("");
}
/**
* Short named analog of System.out.println(String msg);
*/
private static void logln(String str){
System.out.println(str);
}
}
acHelper Tool. 2012 © AChep
If you want copy it, let me know about it and make a link to my profile and thread.
Regards, AChep.​
Reserved for renamer tool
Reserved for my greedy
Спасибо земляк!
Thanx AChep! :good:
What exactly is this tool?

[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

java.lang.NullPointerException error- Attempt to invoke virtual method 'java.lang.Str

I am trying to develop a register system in Android studio, however it registers users but the application closes down as it gives java.lang.NullPointerException error.
Errro Messages
> E/JSON Parser﹕ Error parsing data org.json.JSONException: Value
> 2015-12-09 of type java.lang.String cannot be converted to JSONObject
>
> E/AndroidRuntime﹕ FATAL EXCEPTION: mainPID: 2386
> java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.getString(java.lang.String)' on
> a null object reference
Code:
> at com.bradvisor.bradvisor.Register$ProcessRegister.onPostExecute(Register.java:214)
if (json.getString(KEY_SUCCESS) != null) { - Line 214: where I get an error message, not to sure why
> at com.bradvisor.bradvisor.Register$ProcessRegister.onPostExecute(Register.java:171)
private class ProcessRegister extends AsyncTask<String, String, JSONObject> { - Line 171: where I get an error message, not to sure why.
Register.java File.
Code:
private class ProcessRegister extends AsyncTask<String, String, JSONObject> { - Line 171: where I get an error message, not to sure why.
/**
* Defining Process dialog
**/
private ProgressDialog pDialog;
String email,password,fname,lname,uname;
@Override
protected void onPreExecute() {
super.onPreExecute();
inputUsername = (EditText) findViewById(R.id.uname);
inputPassword = (EditText) findViewById(R.id.pword);
fname = inputFirstName.getText().toString();
lname = inputLastName.getText().toString();
email = inputEmail.getText().toString();
uname= inputUsername.getText().toString();
password = inputPassword.getText().toString();
pDialog = new ProgressDialog(Register.this);
pDialog.setTitle("Contacting Servers");
pDialog.setMessage("Registering ...");
pDialog.setIndeterminate(false);
pDialog.setCancelable(true);
pDialog.show();
}
@Override
protected JSONObject doInBackground(String... args) {
UserFunctions userFunction = new UserFunctions();
JSONObject json = userFunction.registerUser(fname, lname, email, uname, password);
return json;
}
@Override
protected void onPostExecute(JSONObject json) {
/**
* Checks for success message.
**/
try {
if (json.getString(KEY_SUCCESS) != null) { - Line 214: where I get an error message, not to sure why.
registerErrorMsg.setText("");
String res = json.getString(KEY_SUCCESS);
String red = json.getString(KEY_ERROR);
if(Integer.parseInt(res) == 1){
pDialog.setTitle("Getting Data");
pDialog.setMessage("Loading Info");
registerErrorMsg.setText("Successfully Registered");
DatabaseHandler db = new DatabaseHandler(getApplicationContext());
JSONObject json_user = json.getJSONObject("user");
/**
* Removes all the previous data in the SQlite database
**/
UserFunctions logout = new UserFunctions();
logout.logoutUser(getApplicationContext());
db.addUser(json_user.getString(KEY_FIRSTNAME),json_user.getString(KEY_LASTNAME),json_user.getString(KEY_EMAIL),json_user.getString(KEY_USERNAME),json_user.getString(KEY_UID),json_user.getString(KEY_CREATED_AT));
/**
* Stores registered data in SQlite Database
* Launch Registered screen
**/
Intent registered = new Intent(getApplicationContext(), Registered.class);
/**
* Close all views before launching Registered screen
**/
registered.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
pDialog.dismiss();
startActivity(registered);
finish();
}
else if (Integer.parseInt(red) ==2){
pDialog.dismiss();
registerErrorMsg.setText("User already exists");
}
else if (Integer.parseInt(red) ==3){
pDialog.dismiss();
registerErrorMsg.setText("Invalid Email id");
}
}
else{
pDialog.dismiss();
registerErrorMsg.setText("Error occured in registration");
}
} catch (JSONException e) {
e.printStackTrace();
}
}}
public void NetAsync(View view){
new NetCheck().execute();
}}
deleted
Are you sure the object returned from doInBackground is not null ?
@override
protected JSONObject doInBackground(String... args) {
UserFunctions userFunction = new UserFunctions();
JSONObject json = userFunction.registerUser(fname, lname, email, uname, password);(json is null)
return json; ( return null )
}
@override
protected void onPostExecute(JSONObject json) { ( json is null )
/**
* Checks for success message.
**/
try {
if (json.getString(KEY_SUCCESS) != null) { - Line 214: where I get an error message, not to sure why. ( null getString cause exception )

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

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.

[HELP] why Zygisk need to force dlopen /system/bin/app_process

1. Why use android_dlopen_ext in the first_stage_entry function to force open /system/bin/app_process?
2. Why dlclose immediately after dlopen in second_stage_entry? Why do it?
// native/jni/zygisk/entry.cpp
static void first_stage_entry() {
android_logging();
ZLOGD("inject 1st stage\n");
char path[PATH_MAX];
char buf[256];
char *ld = getenv("LD_PRELOAD");
if (char *c = strrchr(ld, ':')) {
*c = '\0';
strlcpy(path, c + 1, sizeof(path));
setenv("LD_PRELOAD", ld, 1); // Restore original LD_PRELOAD
} else {
unsetenv("LD_PRELOAD");
strlcpy(path, ld, sizeof(path));
}
// Force the linker to load the library on top of ourselves, so we do not
// need to unmap the 1st stage library that was loaded with LD_PRELOAD.
int fd = xopen(path, O_RDONLY | O_CLOEXEC);
// Use fd here instead of path to make sure inode is the same as 2nd stage
snprintf(buf, sizeof(buf), "%d", fd);
setenv(MAGISKFD_ENV, buf, 1);
struct stat s{};
xfstat(fd, &s);
android_dlextinfo info {
.flags = ANDROID_DLEXT_FORCE_LOAD | ANDROID_DLEXT_USE_LIBRARY_FD,
.library_fd = fd,
};
// 通过 inode 在 maps 中搜索 /sbin/magisk(app_process) 对应的内存区域
auto [addr, size] = find_map_range(path, s.st_ino);
if (addr && size) {
// 下面使用 android_dlopen_ext 重复加载 /sbin/magisk,
// 通过 reserved_addr 强制覆盖内存.
info.flags |= ANDROID_DLEXT_RESERVED_ADDRESS;
info.reserved_addr = addr;
// The existing address is guaranteed to fit, as 1st stage and 2nd stage
// are exactly the same ELF (same inode). However, the linker could over
// estimate the required size and refuse to dlopen. The estimated size
// is not accurate so size the size to unlimited.
info.reserved_size = -1;
}
setenv(INJECT_ENV_2, "1", 1);
// Force dlopen ourselves to make ourselves dlclose-able.
// After this call, all global variables will be reset.
// 重复加载 /sbin/magisk 到内存, 覆盖之后全局变量将被重置
// 这里为什么要强制 dlopen? 只是为了以后可以使用 dlclose 释放 zygisk 吗????
android_dlopen_ext(path, RTLD_LAZY, &info);
}
Code:
// // native/jni/zygisk/entry.cpp
static void second_stage_entry() {
zygisk_logging();
ZLOGD("inject 2nd stage\n");
char path[PATH_MAX];
MAGISKTMP = getenv(MAGISKTMP_ENV);
int fd = parse_int(getenv(MAGISKFD_ENV));
snprintf(path, sizeof(path), "/proc/self/fd/%d", fd);
xreadlink(path, path, PATH_MAX);
android_dlextinfo info {
.flags = ANDROID_DLEXT_USE_LIBRARY_FD,
.library_fd = fd,
};
// 这里的dlopen并不会重新调用 zygisk_init, 这里是假的dlopen? 只是为了下一行的 dlclose?
// 为什么要这样做?
// Why do this?
self_handle = android_dlopen_ext(path, RTLD_LAZY, &info);
dlclose(self_handle);
close(fd);
unsetenv(MAGISKTMP_ENV);
unsetenv(MAGISKFD_ENV);
sanitize_environ();
hook_functions();
}

Categories

Resources