add_dir (LIBDIR);
add_system_dir (LIBDIR);
main (int argc, char **argv){  int remaining;  /* Parse and process arguments.  */  argp_parse (&argp, argc, argv, 0, &remaining, NULL);  /* Remaining arguments are additional libraries if opt_manual_link     is not set.  */  if (remaining != argc && !opt_manual_link)    {      int i;      for (i = remaining; i < argc; ++i)	add_dir (argv[i]);    }  set_hwcap ();  if (opt_chroot)    {      /* Normalize the path a bit, we might need it for printing later.  */      char *endp = strchr (opt_chroot, '\0');      while (endp > opt_chroot && endp[-1] == '/')	--endp;      *endp = '\0';      if (endp == opt_chroot)	opt_chroot = NULL;      if (opt_chroot)	{	  /* It is faster to use chroot if we can.  */	  if (!chroot (opt_chroot))	    {	      if (chdir ("/"))		error (EXIT_FAILURE, errno, _("Can't chdir to /"));	      opt_chroot = NULL;	    }	}    }  if (cache_file == NULL)    {      cache_file = alloca (strlen (LD_SO_CACHE) + 1);      strcpy (cache_file, LD_SO_CACHE);    }  if (config_file == NULL)    config_file = LD_SO_CONF;  if (opt_print_cache)    {      if (opt_chroot)	{	  char *p = chroot_canon (opt_chroot, cache_file);	  if (p == NULL)	    error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"),		   cache_file);	  cache_file = p;	}      print_cache (cache_file);      if (opt_chroot)	free (cache_file);      exit (0);    }  if (opt_chroot)    {      /* Canonicalize the directory name of cache_file, not cache_file,         because we'll rename a temporary cache file to it.  */      char *p = strrchr (cache_file, '/');      char *canon = chroot_canon (opt_chroot,				  p ? (*p = '\0', cache_file) : "/");      if (canon == NULL)	{	  error (EXIT_FAILURE, errno,		 _("Can't open cache file directory %s\n"),		 p ? cache_file : "/");	}      if (p)	++p;      else	p = cache_file;      cache_file = alloca (strlen (canon) + strlen (p) + 2);      sprintf (cache_file, "%s/%s", canon, p);      free (canon);    }  if (opt_manual_link)    {      /* Link all given libraries manually.  */      int i;      for (i = remaining; i < argc; ++i)	manual_link (argv[i]);      exit (0);    }  if (opt_build_cache)    init_cache ();  if (!opt_only_cline)    {      /* Always add the standard search paths.  */      add_dir (SLIBDIR);      if (strcmp (SLIBDIR, LIBDIR))	add_dir (LIBDIR);      parse_conf (config_file);    }  search_dirs ();  if (opt_build_cache)    save_cache (cache_file);  return 0;}