When using constructor methods they do not get argv and argc. Following code extract is working on standard glibc, but gives coredump on uClibc. Untill fixed I will use /proc/self/cmdline. Example: static void program_environment(int argc, char **argv, char **envp) __attribute__ ((constructor (100))); static void program_environment(int argc, char **argv, char **envp) { int c; static struct option long_options[] = { {"help", 0, 0, 'h'}, {"version", 0, 0, 'v'}, {0, 0, 0, 0} }; opterr = 0; optind = 0; while (1) { int option_index = 0; c = getopt_long(argc, argv, arguments, long_options, &option_index); if (c == -1) break; switch (c) { case 'h': program_help = true; break; case 'v': program_version = true; exit ( 0 ); default: break; } } } int main(int argc, char **argv, char **envp) { program_help = false; while (1) { sleep(10); } }