~ubuntu-branches/ubuntu/oneiric/oss4/oneiric-proposed

« back to all changes in this revision

Viewing changes to .pc/arch_without_mregparm.patch/setup/srcconf_linux.inc

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Rivera
  • Date: 2011-06-16 20:37:48 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110616203748-jbrxik6ql33z54co
Tags: 4.2-build2004-1ubuntu1
* Merge from Debian unstable.
  - Supports our current kernel (LP: #746048)
  Remaining changes:
  - debian/oss4-dkms.dkms.in: s/source/build/ in Kernel headers paths.
* ld-as-needed.patch: Re-order CC arguments to enable building with ld
  --as-needed (LP: #770972)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
static char * fnsp = " -fno-stack-protector";
 
2
 
 
3
#define HAVE_SYSDEP
 
4
#define HAVE_KERNEL_FLAGS
 
5
static void
 
6
check_sysdep (conf_t * conf, struct utsname *un)
 
7
{
 
8
  char *p;
 
9
 
 
10
  char cmd[512];
 
11
 
 
12
#ifndef __arm__
 
13
  vmix_mode = "FLOAT";
 
14
#else
 
15
  exact_architectures = 1; /* Compile only the drivers with targetcpu=arm */
 
16
#endif
 
17
 
 
18
  if ((p=getenv("CROSSCOMPILE"))!=NULL)
 
19
     {
 
20
        if (strcmp(p, "uclinux-blackfin")==0)
 
21
           {
 
22
                hostcc="cc";
 
23
                targetcc="uclinux-blackfin-gcc";
 
24
           }
 
25
#ifdef VXWORKS
 
26
        else if (strcmp(p, "vxworks-x86")==0)
 
27
           {
 
28
                vxworks_setup(conf, "386");
 
29
           }
 
30
#endif
 
31
     }
 
32
 
 
33
  /*
 
34
   * Check if cc supports -fno-stack-protector
 
35
   */
 
36
  sprintf (cmd, "%s -c -o srcconf.o -fno-stack-protector setup/srcconf.c >/dev/null 2>&1", targetcc);
 
37
  if (system(cmd))
 
38
    {
 
39
      fnsp = "";
 
40
    }
 
41
 
 
42
  if (do_warning_checks)
 
43
    strcpy(conf->OSflags, "-Wall -Werror");
 
44
  strcpy (conf->ccomp, targetcc);
 
45
  strcpy (conf->cplusplus, "g++ -fno-rtti -fno-exceptions -I.");
 
46
  strcpy (conf->platform, "i86pc");
 
47
}
 
48
 
 
49
static void
 
50
add_kernel_flags (FILE * f)
 
51
{
 
52
# if defined(__x86_64__)
 
53
  fprintf (f,
 
54
             "CFLAGS += -O3 -fno-common  -mcmodel=kernel -mno-red-zone  -fno-asynchronous-unwind-tables -ffreestanding%s\n", fnsp);
 
55
# else
 
56
#   ifndef __arm__
 
57
  if (getenv ("NO_REGPARM") == NULL)
 
58
        {
 
59
          fprintf (f,
 
60
                   "CFLAGS += -O3 -fno-common -ffreestanding -mregparm=3 -DUSE_REGPARM%s\n", fnsp);
 
61
        }
 
62
  else
 
63
        {
 
64
          fprintf (f, "CFLAGS += -O3 -fno-common -ffreestanding -DNO_REGPARM%s\n", fnsp);
 
65
        }
 
66
#   else
 
67
  fprintf (f, "CFLAGS += -O3 -fno-common -ffreestanding%s\n", fnsp);
 
68
#   endif
 
69
# endif
 
70
}